Initial commit

This commit is contained in:
Ryan Cavicchioni 2019-03-09 00:31:38 +00:00
commit aa28efc5fc
10 changed files with 83 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.retry

5
inventory.yaml Normal file
View File

@ -0,0 +1,5 @@
---
pi:
hosts:
pi:
ansible_connection: local

5
pi.yaml Normal file
View File

@ -0,0 +1,5 @@
---
- hosts: pi
roles:
- common
- dns

View File

@ -0,0 +1,6 @@
---
- name: install system utilities
package:
name: "{{ item }}"
state: present
with_items: "{{ sys_utils }}"

View File

@ -0,0 +1,8 @@
---
sys_utils:
- git
- vim
- tmux
- dnsutils
- ldnsutils
- tcpdump

View 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

View 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
View 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 }}"

View 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 %}

View File

@ -0,0 +1 @@
---