Instead of using expect, setting the ansible_ssh_pass is another solution. Instead of running ansible-playbook inside a script, i can directly use it and it may get the ssh password from group_vars variable. I couldn't make it, thats what i am trying to do now.
On Thu, Jun 22, 2017 at 8:13 AM, Madhu <[email protected]> wrote: > There is a default time out value for expect. That's why its timing out. > To disable the timeout, we are setting as -1. I don't think its ansible > issue. > > On Wed, Jun 21, 2017 at 10:09 PM, Oğuz Yarımtepe <[email protected]> > wrote: > >> The lookup method sounds more Ansible way. timeout -1 solved the issue by >> the way. But i would like to solve the lookup problem also. >> >> On Thu, Jun 22, 2017 at 4:59 AM, Madhu <[email protected]> wrote: >> >>> Hi, >>> >>> I think it's timing out because of the spawn. Use 'set timeout -1' >>> before the spawn command. That should solve the issue. >>> >>> Thanks, >>> Madhu >>> >>> Sent from my iPhone >>> >>> On Jun 21, 2017, at 3:21 PM, Oğuz Yarımtepe <[email protected]> >>> wrote: >>> >>> Great tip. >>> >>> Here is my folder structure: >>> >>> group_vars/all >>> >>> some_playbook/playbook.yml >>> >>> inventory_file >>> >>> >>> $ ansible-playbook -i inventory_file some_playbook/playbook.yml >>> --become-user root --become-method sudo --become >>> >>> >>> # cat group_vars/all >>> --- >>> ansible_ssh_pass: "{{lookup('pipe', '/usr/local/bin/passwordrelease', >>> allow_unsafe=True)}}" >>> ansible_user: root >>> ansible_connection: ssh >>> >>> /usr/local/bin/passwordrelease is echoing the password >>> >>> This didn't work. When i check with -vvvvv i can see it is trying to >>> connect via root but, i got authentication error. >>> Any idea? >>> >>> >>> On Wed, Jun 21, 2017 at 8:36 PM, Brian Coca <[email protected]> wrote: >>> >>>> use a lookup? >>>> >>>> -------- >>>> Brian Coca >>>> >>>> -- >>>> You received this message because you are subscribed to a topic in the >>>> Google Groups "Ansible Project" group. >>>> To unsubscribe from this topic, visit https://groups.google.com/d/to >>>> pic/ansible-project/4vt1Buz9u8A/unsubscribe. >>>> To unsubscribe from this group and all its topics, send an email to >>>> [email protected]. >>>> To post to this group, send email to [email protected]. >>>> To view this discussion on the web visit https://groups.google.com/d/ms >>>> gid/ansible-project/CACVha7fE3gXviKZyynV9xKY_myec1ND%2BYWHMc >>>> uSqyG61RbuH7g%40mail.gmail.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> Oğuz Yarımtepe >>> http://about.me/oguzy >>> >>> -- >>> 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 post to this group, send email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/ansible-project/CAKtWOTTdO3860t0wSCVjxHK5X0oFtME3ukwJSuu >>> U8Syw9muO7w%40mail.gmail.com >>> <https://groups.google.com/d/msgid/ansible-project/CAKtWOTTdO3860t0wSCVjxHK5X0oFtME3ukwJSuuU8Syw9muO7w%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "Ansible Project" group. >>> To unsubscribe from this topic, visit https://groups.google.com/d/to >>> pic/ansible-project/4vt1Buz9u8A/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/ansible-project/AB233546-73AA-43DB-925A-70EB847E4FC9%40gmail.com >>> <https://groups.google.com/d/msgid/ansible-project/AB233546-73AA-43DB-925A-70EB847E4FC9%40gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Oğuz Yarımtepe >> http://about.me/oguzy >> >> -- >> 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 post to this group, send email to [email protected]. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/ansible-project/CAKtWOTTuEoNo1TDMVjh_QrpFkAT3eufo% >> 2BmLSVnw2Jbd-%2BEVxSA%40mail.gmail.com >> <https://groups.google.com/d/msgid/ansible-project/CAKtWOTTuEoNo1TDMVjh_QrpFkAT3eufo%2BmLSVnw2Jbd-%2BEVxSA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/ansible-project/4vt1Buz9u8A/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/ansible-project/CAH93M%2BxV5DqMchzBh%2By2YeCux1nkoqhd0jwKCwAd_ > U2373UjNg%40mail.gmail.com > <https://groups.google.com/d/msgid/ansible-project/CAH93M%2BxV5DqMchzBh%2By2YeCux1nkoqhd0jwKCwAd_U2373UjNg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Oğuz Yarımtepe http://about.me/oguzy -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAKtWOTRAg78B2c3RX3dk2pKySftvxqMB14GBqpwG9FF4kbu56Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
