An Ansible role that configures systemd-resolved.
- Ansible 2.9
Define your DNS servers:
systemd_resolved_servers:
- a.b.c.1
- a.b.c.2
systemd_resolved_fallback_servers:
- d.e.f.1
- d.e.f.2
Define your domains:
systemd_resolved_domains:
- example.com
Other variables in the order they show up along with their default values:
systemd_resolved_dnssec: no
systemd_resolved_dns_over_tls: no
systemd_resolved_multicast_dns: yes
systemd_resolved_llmnr: yes
systemd_resolved_cache: yes
systemd_resolved_cache_from_localhost: no
systemd_resolved_dns_stub_listener: yes
systemd_resolved_dns_stub_listener_extra: ''
systemd_resolved_read_etc_hosts: yes
systemd_resolved_resolve_unicast_single_label: no
systemd_resolved_stale_retention_sec: 0
For more information, read man 5 resolved.conf
.
- collection ansible.posix
Add to requirements.yml
:
---
roles:
- name: idiv_biodiversity.systemd_resolved
src: https://github.com/idiv-biodiversity/ansible-role-systemd-resolved
version: v1.2.0
...
Download:
$ ansible-galaxy install -r requirements.yml
Write a top-level playbook:
---
- name: head server
hosts: head
roles:
- role: idiv_biodiversity.systemd_resolved
tags:
- systemd-resolved
...
Define the role dependency in meta/main.yml
:
---
dependencies:
- role: idiv_biodiversity.systemd_resolved
tags:
- systemd-resolved
...
MIT
This role was created in 2019 by Christian Krause aka wookietreiber at GitHub, HPC cluster systems administrator at the German Centre for Integrative Biodiversity Research (iDiv).