Files
ansible-pull/roles/nameserver/tasks/main.yml
T
rene d0fe8afddc fix bind snmpd validation, wireguard conditional, and step-ca import ordering
- nameserver: add named-checkconf wrapper that validates the edited fragment in
  the context of the full named.conf (lineinfile validate needs %s; isolated
  check fails on include-based configs) and surfaces BIND diagnostics on stderr
- base: make wireguard 'when' boolean-correct (ipaddr('public') returns a string)
- base/nameserver: skip step-ca import in base on nameservers (resolv.conf not
  yet 127.0.0.1) and import it in the nameserver play after DNS setup
2026-10-22 16:21:49 +02:00

64 lines
2.3 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
- 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.
# Jetzt ist die interne Zone auflösbar, also das Root-CA nachziehen.
- 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