rougail-tutorials/playbook.yml

41 lines
1.3 KiB
YAML

---
- name: " ++++ {{ _type | upper }} ++++ "
hosts: localhost
connection: local
tasks:
# Verify if Tiramisu makes some error
- name: Validation Rougail
ansible.builtin.debug:
when: "_type == 'rougail' and '_warnings' in vars and vars['_warnings'] | warn_me"
- name: Validation Rougail
ansible.builtin.assert:
that:
- "'_errors' not in vars"
fail_msg: "{%if '_errors' in vars %}{{ vars._errors }}{%endif%}"
when: "_type == 'rougail'"
# Verify ansible variables
- name: Validation Ansible
include_tasks: "Ansible/asserts/{{ item }}.yml"
when: "_type == 'ansible' and ('Ansible/asserts/' + item + '.yml') is file"
loop:
- apero
- database
- nfs
- omogen
- proxy
- name: Validation Ansible
include_tasks: "Ansible/asserts/proxy.yml"
when: "_type == 'ansible'"
# Display inventory that startswith env_
- name: Display inventory
ansible.builtin.debug:
msg: "{{ item }}"
when: item.key.startswith('env_')
loop: "{{ vars | dict2items }}"
# Display some ansible variables
- name: "Display"
include_tasks: "Ansible/asserts/display.yml"
when: "_type == 'ansible' and 'Ansible/asserts/display.yml' is file"