make sure variables are defined before parsing value

This commit is contained in:
2024-07-22 15:51:13 +02:00
parent 7bcc2f2ff6
commit bff17f9de4
2 changed files with 18 additions and 5 deletions

View File

@@ -6,7 +6,10 @@
- block:
- include_tasks: install_unbound.yml
- include_tasks: configure_unbound_snmpd.yml
when: unbound == true and powerdns_recursor != true
when:
- unbound is defined
- unbound == true
- powerdns is not defined or powerdns_recursor != true
- name: nameserver | unbound | disable systemd-resolved
include_tasks: disable-systemd-resolved.yml
@@ -15,12 +18,18 @@
- block:
- include_tasks: install_bind.yml
- include_tasks: configure_bind_snmpd.yml
when: bind == true and powerdns_auth != true
when:
- bind is defined
- bind == true
- powerdns_auth is not defined or powerdns_auth != true
- block:
- include_tasks: install_powerdns_recursor.yml
- include_tasks: configure_powerdns_recursor_snmpd.yml
when: powerdns_recursor == true and unbound != true
when:
- powerdns_recursor is defined
- powerdns_recursor == true
- unbound is not defined or unbound != true
rescue:
- set_fact: task_failed=true