ansible-playbook isnt really the right tool for writing interactive tooling. There is some very limited support for it but it is not a good approach.
Some of the previous mentioned suggestions (password protected prod only ssh keys and ssh-agent...) will be more useful in the long run. Or using a wrapper script to handle the interactivity if required. But avoid trying to use ansible as an interactive tool. On Tue, Jul 25, 2017 at 7:29 AM, JS <[email protected]> wrote: > Hi Kai > > Thanks for that - it worked like a charm on the CLI! > > - pre_tasks: > - pause: > prompt: "You are running against production. What is the > magic word?" > register: result > when: env == 'prod' > > - fail: > msg: "Aborting, wrong magic." > when: result.user_input | default('') != 'answerable' and env > == 'prod' > > > I've integrated the playbook with Jenkins - so it doesn't work on there. I > get the following error: [WARNING]: Not waiting from prompt as stdin is > not interactive > > But I suppose that's not a problem as we can run DEV/UAT via Jenkins (GUI) > and the PROD environment via CLI. > > -- > 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/8bfcbdfc-a669-4f62-af4a-2b57fa05b30c%40googlegroups. > com > <https://groups.google.com/d/msgid/ansible-project/8bfcbdfc-a669-4f62-af4a-2b57fa05b30c%40googlegroups.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 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/CAOJNLf9-V%3D%2B4BSS5DXr92HYtofkFvtU587i3ZTiZbyNLq%3Dq_XQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
