add dnsmasq role
This commit is contained in:
21
roles/dnsmasq/molecule/default/converge.yml
Normal file
21
roles/dnsmasq/molecule/default/converge.yml
Normal 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
|
||||
27
roles/dnsmasq/molecule/default/molecule.yml
Normal file
27
roles/dnsmasq/molecule/default/molecule.yml
Normal 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 .
|
||||
19
roles/dnsmasq/molecule/default/verify.yml
Normal file
19
roles/dnsmasq/molecule/default/verify.yml
Normal 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"
|
||||
Reference in New Issue
Block a user