Working With Prompts In Ansible
There may be playbooks you run that need to prompt the user for certain input. You can do this using the “vars_prompt” section
- In our setup-app.yml playbook will try to include prompt for upload and info page creation tasks, if user types in “yes” then only playbook should run
- Navigate to /home/ec2-user/ansible/playbooks and modify setup-app.yml playbook, please refer this link
- Now run the playbook, you will be prompt for response
ansible-playbook playbooks/setup-app.yml