Reputation: 1293
I'm learning Ansible and I'm wondering how to write a task to process the following command:
$<command> <options>
username:
email address:
password:
password (check):
The <command> <option>
asks for four variables that can be hardcoded in the playbook.
Thank you for any insight you can provide
Upvotes: 3
Views: 5722
Reputation: 68239
Use expect
module:
- hosts: localhost
tasks:
- expect:
command: command option
responses:
username: "John Doe"
email: "[email protected]"
password: "mypass"
Upvotes: 4