Files
ansible-pull/roles/nameserver/tasks/main.yml
T
rene 37ff1e464e nameserver: disable systemd-resolved on powerdns_server, flush handlers before step-ca
systemd-resolved was only disabled for bind/unbound/powerdns_recursor, so a
pure PowerDNS-server host kept it running on 127.0.0.53:53. Include
powerdns_server in that condition.

Also flush pending service handlers (restart_named/unbound/pdns) before the
step-ca import so the local resolver is actually up when the root CA URL is
fetched.
2026-10-22 18:31:58 +02:00

68 lines
2.5 KiB
YAML
Executable File

# Load distro-specific variables
- include_vars: "{{ ansible_facts['distribution'] | lower }}.yml"
tags: always
- block:
- name: Nameserver | unbound | install and configure
when:
- unbound is defined
- unbound is true
- powerdns_recursor is not defined or powerdns_recursor is false
block:
- name: Nameserver | unbound | install
include_tasks: install_unbound.yml
- name: Nameserver | unbound | configure
include_tasks: configure_unbound_snmpd.yml
- 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 or powerdns_server is true
- name: Nameserver | powerdns-recursor | install and configure
when:
- powerdns_recursor is defined
- powerdns_recursor is true
- unbound is not defined or unbound is false
block:
- name: Nameserver| powerdns-recursor | install
include_tasks: install_powerdns_recursor.yml
- name: Nameserver | powerdns-recursor | configure
include_tasks: configure_powerdns_recursor_snmpd.yml
- name: Nameserver | bind | install and configure
when:
- bind is defined
- bind is true
- powerdns_server is not defined or powerdns_server is false
block:
- name: Nameserver | bind | install
include_tasks: install_bind.yml
- name: Nameserver | bind | configure
include_tasks: configure_bind_snmpd.yml
- name: Nameserver | powerdns-server | install and configure
when:
- powerdns_server is defined
- powerdns_server is true
- bind is not defined or bind is false
block:
- name: Nameserver | powerdns-server | install
include_tasks: install_powerdns_server.yml
- name: Nameserver | powerdns-server | configure
include_tasks: configure_powerdns_server_snmpd.yml
# Der Base-Play überspringt den step-ca Import auf Nameservern, weil deren
# /etc/resolv.conf erst hier (nach dem DNS-Setup) auf 127.0.0.1 zeigt.
# Erst die ausstehenden Handler (restart_named/unbound/pdns) ausführen, damit
# der DNS-Server läuft und die interne Zone inkl. step-ca auflösen kann.
- name: Nameserver | system setup | flush handlers before step-ca import
meta: flush_handlers
- name: Nameserver | system setup | import step-ca certificate
include_role:
name: base
tasks_from: system_setup/import_stepca.yml
rescue:
- set_fact: task_failed=true