Thanks .. its working now On Friday, August 4, 2023 at 4:14:49 PM UTC+5:30 Dick Visser wrote:
> Try removing the semi colon after false > > On Fri, 4 Aug 2023 at 12:25, Veera <[email protected]> wrote: > >> Hi , >> >> I have 3 servers serverA ,serverB , and serverC. >> From serverA , I am trying to execute the playbook on serverB which is >> the control node(Where ansible is available). >> >> The playbook when run from serverB(login with ssh) with executing as >> below works fine and got the expected output. >> >> # export ANSIBLE_HOST_KEY_CHECKING=False >> # ansible-playbook /home/ansible/playbook1.yml --limit serverC >> --key-file /home/ansible/priv_key.file >> >> The playbook has "become: true" >> >> From ServerA , I am executing the below command using a bash script and >> the script works. But the execution is not happening >> >> #!/bin/bash >> ssh -i .ssh/serverb_key root@serverB "export >> ANSIBLE_HOST_KEY_CHECKING=False; ansible-playbook >> /home/ansible/playbook1.yml --limit serverC --key-file >> /home/ansible/priv_key.file" >> >> The requirement is to initiate the script from serverA - which will >> execute the playbook in serverB and do the changes in serverC. >> I even try with the "&" at the end to execute the ansible-playbook in >> the background ..but still the same result. ""export >> ANSIBLE_HOST_KEY_CHECKING=False; ansible-playbook >> /home/ansible/playbook1.yml --limit serverC --key-file >> /home/ansible/priv_key.file &" >> >> >> >> >> >> >> >> >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ansible Project" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/591279df-3595-477f-a30f-dc86a4ea5959n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/591279df-3595-477f-a30f-dc86a4ea5959n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > Sent from Gmail Mobile > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/71155c6e-e096-484f-86ef-b055d0cf390cn%40googlegroups.com.
