Skip to content

Commit 36efcdf

Browse files
committed
Add an assertion to verify validity of systemd_resolved_dns_stub_listener
1 parent 2b35b8d commit 36efcdf

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tasks/main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
---
2+
- name: Verify role variables
3+
block:
4+
- name: Verify value of systemd_resolved_dns_stub_listener
5+
ansible.builtin.assert:
6+
fail_msg: >
7+
Invalid value for systemd_resolved_dns_stub_listener: {{
8+
systemd_resolved_dns_stub_listener }}. Valid values are the
9+
strings tcp or udp, or a boolean value.
10+
# True if any of the elements of conditions is true
11+
that: conditions is any
12+
vars:
13+
conditions:
14+
- systemd_resolved_dns_stub_listener is boolean
15+
- systemd_resolved_dns_stub_listener is string and systemd_resolved_dns_stub_listener == "tcp"
16+
- systemd_resolved_dns_stub_listener is string and systemd_resolved_dns_stub_listener == "udp"
17+
218
- name: Load var file with package names based on the OS type
319
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
420
vars:

0 commit comments

Comments
 (0)