aman kumar chagti
aman kumar chagti

Reputation: 83

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

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.

Upvotes: 2

Views: 727

Answers (1)

YLR
YLR

Reputation: 1540

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'

Upvotes: 2

Related Questions