Some checks failed
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-centos9) (push) Failing after 12s
57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
---
|
|
- name: AAP and Surveys
|
|
hosts: all
|
|
gather_facts: false
|
|
become: false
|
|
|
|
tasks:
|
|
- name: Example of 'Text'
|
|
ansible.builtin.debug:
|
|
var: aap_survey_text
|
|
|
|
- name: Example of 'Textarea'
|
|
ansible.builtin.debug:
|
|
var: aap_survey_textarea
|
|
|
|
# Need to be careful here. While password fields
|
|
# are masked in AAP, during execution they can
|
|
# be displayed through examples like this:
|
|
- name: Example of 'password'
|
|
ansible.builtin.debug:
|
|
var: aap_survey_password
|
|
|
|
- name: Example of 'Multiple Choice (single select)'
|
|
ansible.builtin.debug:
|
|
var: aap_survey_choose_single
|
|
|
|
# Multiplechoice survey's come across as a list...
|
|
- name: Example of 'Multiple Choice (multiple select)'
|
|
ansible.builtin.debug:
|
|
var: aap_survey_choose_multiple
|
|
|
|
# Here we loop through the choices, and if its 'World'
|
|
# we display a message:
|
|
- name: Loop through selections and act if its 'World'
|
|
ansible.builtin.debug:
|
|
msg: "Hello {{ item }}"
|
|
loop: "{{ aap_survey_choose_multiple }}"
|
|
when:
|
|
- "'World' in item"
|
|
|
|
# Here we loop through the choices, and if its 'Two'
|
|
# we display a message:
|
|
- name: Loop through selections and act if its 'Two'
|
|
ansible.builtin.debug:
|
|
msg: "One... {{ item }}... Three..."
|
|
loop: "{{ aap_survey_choose_multiple }}"
|
|
when:
|
|
- "'Two' in item"
|
|
|
|
- name: Example of 'Integer'
|
|
ansible.builtin.debug:
|
|
var: aap_survey_integer
|
|
|
|
- name: Example of 'Float'
|
|
ansible.builtin.debug:
|
|
var: aap_survey_float
|