Hi, I am using ansible-playbook at a script and passing password to t. Below is how i used it:
run.sh #!/bin/bash ... /bin/expect <<- DONE spawn ansible-playbook -i $1 $2 -u $Username -k --become-user root --become-method sudo --become expect "SSH password: " send "$Password\r" expect eof DONE $ bash run.sh test.txt test/playbook.yml # cat cyberark.txt [all] FOO01 FOO02 FOO03 FOO04 FOO05 # bash run.sh foo.txt test/playbook.yml spawn ansible-playbook -i test.txt foo/playbook.yml -u testuser -k --become-user root --become-method sudo --become SSH password: PLAY [Swap operations] ********************************************************* TASK [setup] ******************************************************************* ok: [FOO01] TASK [swap_ops : swapoff] ****************************************************** changed: [FOO01] TASK [swap_ops : swapon] ******************************************************* changed: [FOO01] PLAY [Swap operations] ********************************************************* TASK [setup] ******************************************************************* ok: [FOO02] TASK [swap_ops : swapoff] ****************************************************** changed: [FOO02] TASK [swap_ops : swapon] ******************************************************* changed: [FOO02] PLAY [Swap operations] ********************************************************* TASK [setup] ******************************************************************* ok: [FOO03] TASK [swap_ops : swapoff] ****************************************************** Any idea why the playbook is ended at the 3rd one? when i use a inventory with two hosts, everything is fine. When the number of hosts in inventory increases, ansible is ending at some hosts. It may be because of spawn usage. Any solution will be appreciated. -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0faaa208-66a0-4591-af16-8ca95d1e4330%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.