I am trying to skip the next three prompts if the user inputs y to the first prompt.
---
- name: User MOTD Script
hosts: localhost
vars_prompt:
- name: "defaultMOTD"
prompt: "Do you want to set the MOTDs to the default? (y/n)"
private: no
- name: "MOTD"
prompt: "Please input your MOTD for /etc/motd: "
private: no
when: defaultMOTD != "y"
- name: "MOTDIssue"
prompt: "Please input your MOTD for /etc/issue: "
private: no
when: defaultMOTD != "y"
- name: "MOTDIssueNet"
prompt: "Please input your MOTD for /etc/issue.net: "
private: no
when: defaultMOTD != "y"
Output when y is inputted on the first prompt.
Do you want to set the MOTDs to the default? (y/n): y
Please input your MOTD for /etc/motd: :
Please input your MOTD for /etc/issue: :
Please input your MOTD for /etc/issue.net: :
The 2nd,3rd and 4th prompts should be skipped.