Initial commit
This commit is contained in:
commit
aa28efc5fc
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.retry
|
5
inventory.yaml
Normal file
5
inventory.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
pi:
|
||||||
|
hosts:
|
||||||
|
pi:
|
||||||
|
ansible_connection: local
|
6
roles/common/tasks/main.yaml
Normal file
6
roles/common/tasks/main.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: install system utilities
|
||||||
|
package:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
with_items: "{{ sys_utils }}"
|
8
roles/common/vars/main.yaml
Normal file
8
roles/common/vars/main.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
sys_utils:
|
||||||
|
- git
|
||||||
|
- vim
|
||||||
|
- tmux
|
||||||
|
- dnsutils
|
||||||
|
- ldnsutils
|
||||||
|
- tcpdump
|
23
roles/dns/defaults/main.yaml
Normal file
23
roles/dns/defaults/main.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
unbound_package_name: 'unbound'
|
||||||
|
unbound_package_state: 'present'
|
||||||
|
|
||||||
|
unbound_service_name: 'unbound'
|
||||||
|
unbound_service_state: 'started'
|
||||||
|
unbound_service_enabled: yes
|
||||||
|
|
||||||
|
unbound_forward_zones:
|
||||||
|
- name: .
|
||||||
|
forward_addr:
|
||||||
|
- 2606:4700:4700::1111
|
||||||
|
- 2001:4860:4860::8888
|
||||||
|
- 2620:fe::fe
|
||||||
|
- 2606:4700:4700::1001
|
||||||
|
- 2001:4860:4860::8844
|
||||||
|
- 2620:fe::9
|
||||||
|
- 1.1.1.1
|
||||||
|
- 8.8.8.8
|
||||||
|
- 9.9.9.9
|
||||||
|
- 1.0.0.1
|
||||||
|
- 8.8.4.4
|
||||||
|
- 149.112.112.112
|
6
roles/dns/handlers/main.yaml
Normal file
6
roles/dns/handlers/main.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: reload unbound
|
||||||
|
service:
|
||||||
|
name: "{{ unbound_service_name }}"
|
||||||
|
state: reloaded
|
||||||
|
when: "{{ unbound_service_enabled }}"
|
19
roles/dns/tasks/main.yaml
Normal file
19
roles/dns/tasks/main.yaml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
- name: install unbound
|
||||||
|
package:
|
||||||
|
name: "{{ unbound_package_name }}"
|
||||||
|
state: "{{ unbound_package_state }}"
|
||||||
|
|
||||||
|
- name: configure unbound
|
||||||
|
template:
|
||||||
|
src: forward.conf.j2
|
||||||
|
dest: /etc/unbound/unbound.conf.d/forward.conf
|
||||||
|
validate: 'unbound-checkconf %s'
|
||||||
|
notify:
|
||||||
|
- reload unbound
|
||||||
|
|
||||||
|
- name: start unbound
|
||||||
|
service:
|
||||||
|
name: "{{ unbound_service_name }}"
|
||||||
|
state: "{{ unbound_service_state }}"
|
||||||
|
enabled: "{{ unbound_service_enabled }}"
|
9
roles/dns/templates/forward.conf.j2
Normal file
9
roles/dns/templates/forward.conf.j2
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{% if unbound_forward_zones %}
|
||||||
|
forward-zone:
|
||||||
|
{% for zone in unbound_forward_zones %}
|
||||||
|
name: "{{ zone.name }}"
|
||||||
|
{% for addr in zone.forward_addr %}
|
||||||
|
forward-addr: {{ addr }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
1
roles/dns/vars/RedHat.yaml
Normal file
1
roles/dns/vars/RedHat.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
---
|
Loading…
Reference in New Issue
Block a user