Ansible: Is there any way to use or pass ansible vars to a bash script I am deploying? -


i hacking ansible solution deploy notify.sh bash script part of pam.d / pam_exec configuration.

the script uses bunch of variables have been told need part of separate yml file (so others can change or update them) instead of being defined in script directly, used doing.

i have constructed vars file have defined variables script should using @ runtime.

now problem want able access ansible variables in standard format {{my_variable}} bash script deploying.

is possible? if isn't possible, suggestions inserting variables script after installed?

i have feeling close answer, scowering ansible files has not yielded yet.

the thing kinda figured use lineinfile module update shell script after installed, feel maybe bit hacky , there more elegant solution here.

i appreciate , answers.

sure – in /vars/main.yml automatically available, or can load custom file http://docs.ansible.com/ansible/include_vars_module.html. then, use template , deploy script this:

 template:     src: script_template.j2     dest: "path/notifiy.sh"     mode: 700 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -