Alexander.Iljushkin
Alexander.Iljushkin

Reputation: 4576

How to catch user prompts in ansible?

I have an sql script which asks for user input in the command line.

How can I somehow catch this prompt with some criteria and input some text while running ansible script?

upd:

I need to catch requests for manual input and instead of manually input values, input them programmatically.

Upvotes: 0

Views: 523

Answers (1)

Konstantin Suvorov
Konstantin Suvorov

Reputation: 68239

Please look at expect module.

# Case insensitve password string match
- expect:
    command: passwd username
    responses:
      (?i)password: "MySekretPa$$word"

Upvotes: 1

Related Questions