Jul-05-2020, 04:38 PM
I want to execute below ansible playbook using python, can some one help me with subprocess for a variable? Basically am trying to achieve executing the ansible command with python like below with a variable.
Command: ""/bin/ansible-playbook PlayBook.yml --extra-vars appName={var1}""
I have value of the variable as myFirstApp, trying to put that on the command.
var=myFirstApp
below doesn't works, "var" is not getting resolved.
Any help is appreciated
Thanks
Command: ""/bin/ansible-playbook PlayBook.yml --extra-vars appName={var1}""
I have value of the variable as myFirstApp, trying to put that on the command.
var=myFirstApp
below doesn't works, "var" is not getting resolved.
Quote:subprocess.check_call(["/bin/ansible-playbook", "tomcatPlayBook.yml", "--extra-vars", "appName={var}"])
Any help is appreciated
Thanks