This is an Ansible role that installs and configures
systemd-resolved
.
It performs the following actions:
- Installs
systemd-resolved
and ensures thatresolvconf
is not installed. - Creates an
/etc/resolv.conf
symlink. - Optionally disables the
systemd-resolved
stub DNS resolver that listens at127.0.0.53
.
None.
Variable | Description | Default | Required |
---|---|---|---|
systemd_resolved_dns_stub_listener | The value to use for the DNSStubListener value in the systemd-resolved configuration file. Must be tcp , udp , or a boolean value. See here for more information. |
true |
No |
systemd_resolved_dropin_config_file | The location of the systemd-resolved drop-in configuration file that will be created. | /etc/systemd/resolved.conf.d/99-ansible-role-systemd-resolved |
No |
systemd_resolved_resolv_conf_filename | The location of the target to which /etc/resolv.conf will be symlinked. Note that dynamic_resolv_conf_target_dir and static_resolv_conf_target_dir are role vars that are available for use when defining this variable. See here for more information. |
"{{ dynamic_resolv_conf_target_dir }}/stub-resolv.conf" |
No |
None.
This role can be installed via the command:
ansible-galaxy install --role-file path/to/requirements.yml
where requirements.yml
looks like:
---
- name: systemd_resolved
src: https://github.com/cisagov/ansible-role-systemd-resolved
and may contain other roles as well.
For more information about installing Ansible roles via a YAML file,
please see the ansible-galaxy
documentation.
Here's how to use it in a playbook:
- hosts: all
become: true
become_method: sudo
tasks:
- name: Include systemd-resolved
ansible.builtin.include_role:
name: systemd_resolved
We welcome contributions! Please see CONTRIBUTING.md
for
details.
This project is in the worldwide public domain.
This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.
All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.
Shane Frasier - [email protected]