Working With Prompts In Ansible

0 56

There may be playbooks you run that need to prompt the user for certain input. You can do this using the “vars_prompt” section

  1. 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
  2. Navigate to /home/ec2-user/ansible/playbooks and modify setup-app.yml playbook, please refer this link
  3. Now run the playbook, you will be prompt for response
    ansible-playbook playbooks/setup-app.yml

Leave A Reply

Your email address will not be published.