add dnsmasq role

This commit is contained in:
Sergey Malyuk
2025-12-11 10:27:01 +03:00
parent 2902ab08b3
commit d8118cdd8c
19 changed files with 235 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
---
- name: Converge
hosts: all
roles:
- role: genlab.ufw
disable_ipv6: true
rules:
- rule: allow
# proto: udp
port: 5300
interface: lo
direction: in
comment: "Allow dnsmasq to serve DNS queries on the given interface"
- role: genlab.dnsmasq
iface: lo
domain: adm.local
dns_port: 5300
nodes:
- name: hub
ip: 127.0.0.1

View File

@@ -0,0 +1,27 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: ubuntu
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest
pre_build_image: true
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
provisioner:
name: ansible
verifier:
name: ansible
lint: |
set -e
yamllint .
ansible-lint .

View File

@@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
any_errors_fatal: true
pre_tasks:
- name: "Install a package providing the `dig` tool"
ansible.builtin.apt:
name: dnsutils
state: present
tasks:
- name: "Test the output of the `dig` command"
changed_when: false
register: dig
failed_when: 'dig.stdout != "127.0.0.1"'
ansible.builtin.command:
cmd: "dig @127.0.0.1 -p 5353 hub.adm.vpn +short"