This Ansible role installs and configures dnsmasq as a local DNS forwarder on Debian hosts.
The Ansible Role is written and actively maintained by Blunix GmbH. It is used in the Blunix Linux Managed Hosting Stack. Its usage is documented at our Linux Managed Hosting Documentation.
- Installs
dnsmasq. - Removes
dnscrypt-proxyif present. - Manages
/etc/dnsmasq.d/99-ansible.confwith upstream resolvers fromdnsmasq_dns_servers. - Adds a cleanup cron job for
/etc/resolv.conf.dhclient-new.*temp files.
- Ansible: >= 2.20.0
- Managed operating systems:
- Debian trixie
Role variable:
dnsmasq_dns_servers: upstream DNS resolver list used to renderserver=lines in/etc/dnsmasq.d/99-ansible.conf.- default:
9.9.9.98.8.8.8
- example mapping used in this role's
example/inventory/group_vars/all/dnsmasq.yml:dnsmasq_dns_servers: "{{ dns_servers_hosting_provider }}"
- default:
Example playbook:
# Apply dnsmasq role to all hosts in the inventory.
- name: setup dnsmasq
hosts: all
roles:
- role: ansible-role-dnsmasq- Playbook:
example/play.ymlapplies the role to the test host group. - Inventory vars:
example/inventory/group_vars/all/dnsmasq.ymlmaps role variablednsmasq_dns_serverstodns_servers_hosting_provider. - Provider vars:
example/inventory/group_vars/hcloud.ymlprovidesdns_servers_hosting_provider. - Tests in
example/tests/cus-dev-prod-web-1/:test_package.pychecks package install/remove state.test_service.pychecks service state.test_config_file.pychecks rendered dnsmasq config ownership, mode, and resolver lines.test_listener.pychecks DNS listeners on port53.test_cron.pychecks the resolv.conf temp-file cleanup cron entry.
Blunix GmbH Berlin
root@Linux:~# Support | Consulting | Hosting | Training
Blunix GmbH provides 24/7/365 Linux emergency support and consulting, Service Level Agreements for Debian Linux managed hosting using Ansible Configuration Management as well as Linux trainings and workshops.
Learn more at https://www.blunix.com.
Click here to see our Contact Information.
For bug reports and feature requests, please open an issue in this repository’s GitHub issue tracker.
Apache-2.0
Please refer to the LICENSE file in the root of this repository.