Files
ansible-pull/roles/nameserver/tasks/main.yml
2024-07-22 17:16:52 +02:00

45 lines
1.5 KiB
YAML

# Load distro-specific variables
- include_vars: "{{ ansible_distribution | lower }}.yml"
tags: always
- block:
- name: nameserver | unbound | install and configure
block:
- name: nameserver | unbound | install
include_tasks: install_unbound.yml
- name: nameserver | unbound | configure
include_tasks: configure_unbound_snmpd.yml
when:
- unbound is defined
- unbound is true
- powerdns_recursor is not defined or powerdns_recursor is false
- name: nameserver | unbound | disable systemd-resolved
include_tasks: disable-systemd-resolved.yml
when: bind is true or unbound is true or powerdns_recursor is true
- name: nameserver | powerdns-recursor | install and configure
block:
- name: nameserver| powerdns-recursor | install
include_tasks: install_powerdns_recursor.yml
- name: nameserver | powerdns-recursor | configure
include_tasks: configure_powerdns_recursor_snmpd.yml
when:
- powerdns_recursor is defined
- powerdns_recursor is true
- unbound is not defined or unbound is false
- name: nameserver | bind | install and configure
block:
- name: nameserver | bind | install
include_tasks: install_bind.yml
- name: nameserver | bind | configure
include_tasks: configure_bind_snmpd.yml
when:
- bind is defined
- bind is true
- powerdns_auth is not defined or powerdns_auth is false
rescue:
- set_fact: task_failed=true