I have a bash script I am running in ansible with the script module. However, it needs a specific positional parameter to be specified as a server-name to function in this case as $1. I am attempting to find a way to do that in ansible, but so far have been unsuccessful. I would love to do this with the built in modules, but the selinux one requires installations on the target machine to enable this functionality, and that won't fly on production servers. :(
Just below is how I would run the script without ansible:
bash selinux-disabler-ans.sh <servername>
The above runs just fine on it's own. However, how would I provide in an ansible playbook? Here is what I'm using for that section below:
- name: Remediate/Disable selinux, it will only harm configurations right now, and should be disabled. script: /opt/selinux-disabler-ans.sh
I can't just hardcode an argument for the script as I need it to be able to change, as this will run across an entire host realm. I'd really love for this to pick up the positional parameter at runtime, possibly using the host it's running on right at the moment, or specified through --limit perhaps? Right now I'm running this script with my own juryrigged automation, but I really want ansible to be able to do it. Anyone have any ideas?