How to provide custom input on "Do you want to continue" prompt in ansible?

Viewed 249

While using Linux when we try to install something using the command line we get a prompt

"Do you want to continue"[Y/N]..

I want to automate it using an ansible-playbook.

1 Answers

For this kind of use case, the module expect could be use.

For example in your case a basic task looks like this :

- name : "Provide custom input"
  expect:
    command: 'launch.sh'
    responses:
      'Do you want to continue\"\[Y\/N\]\"': 'y'
Related