feat(conduwuit): add ansible role
This commit is contained in:
34
roles/conduwuit/tasks/check.yml
Normal file
34
roles/conduwuit/tasks/check.yml
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
- name: Ensure 'conduwuit_state' is valid
|
||||
ansible.builtin.fail:
|
||||
msg: >-2
|
||||
State '{{ conduwuit_state }}' is not known,
|
||||
supported states are {{ conduwuit_states | join(', ') }}
|
||||
when: conduwuit_state not in conduwuit_states
|
||||
|
||||
- name: Ensure 'conduwuit_deployment_method' is supported
|
||||
ansible.builtin.fail:
|
||||
msg: >-2
|
||||
Deployment method '{{ conduwuit_deployment_method }}'
|
||||
is unknown! Supported methods are:
|
||||
{{ conduwuit_deployment_methods | join(', ') }}
|
||||
when: conduwuit_deployment_method not in conduwuit_deployment_methods
|
||||
|
||||
- name: Ensure required variables are given
|
||||
ansible.builtin.fail:
|
||||
msg: "Required variable '{{ item }}' is undefined!"
|
||||
loop: "{{ conduwuit_required_variables }}"
|
||||
when: >-2
|
||||
item not in hostvars[inventory_hostname]
|
||||
or hostvars[inventory_hostname][item] | length == 0
|
||||
|
||||
- name: Ensure conditionally required variables are given
|
||||
ansible.builtin.fail:
|
||||
msg: "Required variable '{{ item.name }}' is undefined!"
|
||||
loop: "{{ conduwuit_conditionally_required_variables }}"
|
||||
loop_control:
|
||||
label: "{{ item.name }}"
|
||||
when: >-2
|
||||
item.when
|
||||
and (item.name not in hostvars[inventory_hostname]
|
||||
or hostvars[inventory_hostname][item.name] | length == 0)
|
Reference in New Issue
Block a user