feat(validation): refuse a variable declared by two input specs

This commit is contained in:
2026-10-05 18:08:55 +02:00
parent 7253f6af96
commit 73136b7ebb
2 changed files with 24 additions and 0 deletions
+20
View File
@@ -14,6 +14,26 @@
loop_var: inf
label: "{{ inf.name }}"
- name: Refuse a variable declared by two specs
block:
- name: Run the validator with the fixture spec twice
validate_inputs:
specs:
- "{{ playbook_dir }}/fixture_spec.yml"
- "{{ playbook_dir }}/fixture_spec.yml"
register: inputs_duplicate_result
rescue:
- name: Keep the duplicate-declaration failure
ansible.builtin.set_fact:
inputs_duplicate_result: "{{ ansible_failed_result }}"
- name: Assert the duplicate declaration was refused
ansible.builtin.assert:
that:
- inputs_duplicate_result.msg is search('fixture is declared by both')
fail_msg: "[inputs duplicate] got {{ inputs_duplicate_result.msg | default('') }}"
success_msg: "[inputs duplicate] OK"
- name: Validate a host var holding values that cannot be decrypted
block:
- name: Run the validator on the vaulted host var