Added another group_names validation

This commit is contained in:
Kevin Veen-Birkenbach 2025-08-18 21:37:07 +02:00
parent 5adce08aea
commit dc0bb555c1
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
2 changed files with 9 additions and 1 deletions

View File

@ -21,6 +21,14 @@
applications: "{{ defaults_applications | merge_with_defaults(applications | default({}, true)) }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
- name: "Sanity check: all group_names must exist in applications"
assert:
that:
- item in applications
fail_msg: "Group '{{ item }}' has no entry in 'applications'"
success_msg: "Group '{{ item }}' is defined in 'applications'"
loop: "{{ group_names }}"
- name: Merge current play applications
set_fact:
current_play_applications: >-

View File

@ -218,7 +218,7 @@ class TestVariableDefinitions(unittest.TestCase):
if var in (
'lookup', 'role_name', 'domains', 'item', 'host_type',
'inventory_hostname', 'role_path', 'playbook_dir',
'ansible_become_password', 'inventory_dir', 'ansible_memtotal_mb', 'omit'
'ansible_become_password', 'inventory_dir', 'ansible_memtotal_mb', 'omit', 'group_names'
):
continue