If I am running the shell module to run a script and I want to pass a url into the script how would I do this? Can’t use a variable because it’s not a dict word?
For example the script is :
echo $url > test.output
The playbook has a task running :
shell echo.sh
If I have a configuration file where the url’s are contained, how can I pass it to the script?
Not quite. basically right now I have 10 individual servers where I run a script to bring up a chromium browser output is hdmi. Basically
I have a videowall with monitors. Each server has the script and a local screen.conf file which contains the url string.
But instead of logging into each server to change the url or restart the script I want to do this with ansible.
The script and everything is running just fine using the script. Except of course I want a screen.conf to reside on the ansible server
and not on the remote server. So that when I run the restart script the url is passed into the script and everything is controlled from
the ansible server logging into the remote servers.
Basically I am not sure how to pass on the url to the remote server script.
The example I gave is very basic, just assume that the echo.sh is located on the remote server and the url file is located on the ansible
server. Let’s assume screen.conf, so when I run the echo.sh using the shell module I need it to grab the url from the screen.conf
and then pass it to the echo.sh script where it’s referenced as $url.
it would be easier if it were a host/group vars file or even a proper
ini file (there is an ini lookup plugin in queue). But if that is what
you have and assuming the caption is per inventory hostname:
Thanks Brian, will look into that and see if I can make it work.
Someone else brought up a very easy solution, simply have multiple config files on the ansible server and do a copy
to the dest. It’s funny how I was so determined to get it done a certain way, while a simple solution was right
in front of me.