system-config/playbooks/roles/nameserver/tasks/main.yaml

43 lines
1.0 KiB
YAML

# Install the NSD config before installing the package because the
# default packaged config listens on all addresses therefore will
# not start.
- name: Ensure NSD config directory exists
file:
path: /etc/nsd
state: directory
- name: Install NSD config
template:
src: templates/nsd.conf.j2
dest: /etc/nsd/nsd.conf
owner: root
group: root
mode: 0444
notify: Reconfigure NSD
- name: Install packages
package:
name:
- nsd
- name: Create nsd unit file override dir
file:
path: /etc/systemd/system/nsd.service.d
state: directory
owner: root
group: root
mode: 0755
- name: Create nsd unit file override config
# This is necessary to force nsd to start after networking is up.
# Upstream package is broken when not listening on :: or ::1
copy:
owner: root
group: root
mode: 0644
dest: /etc/systemd/system/nsd.service.d/deps.conf
content: |
[Unit]
After=network-online.target
Wants=network-online.target
- name: Enable NSD
service:
name: nsd
enabled: true