fix linter errors
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
---
|
---
|
||||||
cache_size: 100
|
dnsmasq_cache_size: 100
|
||||||
dns_port: 5300
|
dnsmasq_dns_port: 5300
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: all
|
hosts: all
|
||||||
roles:
|
roles:
|
||||||
- role: genlab.ufw
|
- role: genlab.common.ufw
|
||||||
disable_ipv6: true
|
disable_ipv6: true
|
||||||
rules:
|
rules:
|
||||||
- rule: allow
|
- rule: allow
|
||||||
@@ -12,10 +12,10 @@
|
|||||||
direction: in
|
direction: in
|
||||||
comment: "Allow dnsmasq to serve DNS queries on the given interface"
|
comment: "Allow dnsmasq to serve DNS queries on the given interface"
|
||||||
|
|
||||||
- role: genlab.dnsmasq
|
- role: genlab.common.dnsmasq
|
||||||
iface: lo
|
dnsmasq_iface: lo
|
||||||
domain: adm.local
|
dnsmasq_domain: adm.local
|
||||||
dns_port: 5300
|
dnsmasq_dns_port: 5300
|
||||||
nodes:
|
dnsmasq_nodes:
|
||||||
- name: hub
|
- name: hub
|
||||||
ip: 127.0.0.1
|
ip: 127.0.0.1
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: "Test the output of the `dig` command"
|
- name: "Test the output of the `dig` command"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: dig
|
register: dnsmasq_dig
|
||||||
failed_when: 'dig.stdout != "127.0.0.1"'
|
failed_when: 'dig.stdout != "127.0.0.1"'
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: "dig @127.0.0.1 -p 5353 hub.adm.vpn +short"
|
cmd: "dig @127.0.0.1 -p 5353 hub.adm.vpn +short"
|
||||||
|
|||||||
@@ -9,29 +9,29 @@
|
|||||||
- name: "Create interface-specific configuration file"
|
- name: "Create interface-specific configuration file"
|
||||||
notify: "Restart dnsmasq"
|
notify: "Restart dnsmasq"
|
||||||
ansible.builtin.blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/dnsmasq.d/{{ domain }}.conf
|
path: /etc/dnsmasq.d/{{ dnsmasq_domain }}.conf
|
||||||
create: true
|
create: true
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: "0660"
|
mode: "0660"
|
||||||
block: |
|
block: |
|
||||||
interface="{{ iface }}"
|
interface="{{ dnsmasq_iface }}"
|
||||||
port="{{ dns_port }}"
|
port="{{ dnsmasq_dns_port }}"
|
||||||
cache-size="{{ cache_size }}"
|
cache-size="{{ dnsmasq_cache_size }}"
|
||||||
log-queries
|
log-queries
|
||||||
server=1.1.1.1 # Cloudflare DNS
|
server=1.1.1.1 # Cloudflare DNS
|
||||||
server=8.8.8.8 # Google DNS
|
server=8.8.8.8 # Google DNS
|
||||||
server=8.8.4.4 # Google DNS (secondary)
|
server=8.8.4.4 # Google DNS (secondary)
|
||||||
|
|
||||||
|
|
||||||
- name: "Add nodes to the configuration file"
|
- name: "Add dnsmasq_nodes to the configuration file"
|
||||||
notify: "Restart dnsmasq"
|
notify: "Restart dnsmasq"
|
||||||
loop: "{{ nodes }}"
|
loop: "{{ dnsmasq_nodes }}"
|
||||||
ansible.builtin.blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/dnsmasq.d/{{ domain }}.conf
|
path: /etc/dnsmasq.d/{{ dnsmasq_domain }}.conf
|
||||||
marker: "# {mark} ANSIBLE MANAGED: {{ item.name }}.{{ domain }}"
|
marker: "# {mark} ANSIBLE MANAGED: {{ item.name }}.{{ dnsmasq_domain }}"
|
||||||
block: |
|
block: |
|
||||||
address=/{{ item.name }}.{{ domain }}/{{ item.ip }}
|
address=/{{ item.name }}.{{ dnsmasq_domain }}/{{ item.ip }}
|
||||||
|
|
||||||
|
|
||||||
- name: "Flush handlers"
|
- name: "Flush handlers"
|
||||||
|
|||||||
Reference in New Issue
Block a user