diff --git a/host_vars/mewimeet.de.yml b/host_vars/mewimeet.de.yml index 5b673bb..9a23a8c 100644 --- a/host_vars/mewimeet.de.yml +++ b/host_vars/mewimeet.de.yml @@ -19,6 +19,8 @@ set_hosts: true unattended_upgrades: true web_server: true netdata: true +bind: true +unbound: true # VPN wireguard: true diff --git a/hosts b/hosts index cad0a73..09200e2 100644 --- a/hosts +++ b/hosts @@ -40,6 +40,7 @@ tuxedo-book-xp1511.universe.local [nameserver] coruscant.universe.local +mewimeet.de [photo_editing] endor.universe.local diff --git a/roles/nameserver/tasks/configure_unbound_snmpd.yml b/roles/nameserver/tasks/configure_unbound_snmpd.yml new file mode 100644 index 0000000..bde2052 --- /dev/null +++ b/roles/nameserver/tasks/configure_unbound_snmpd.yml @@ -0,0 +1,15 @@ +- name: nameserver | snmpd | get script + get_url: + url: "https://github.com/librenms/librenms-agent/raw/master/snmp/unbound" + dest: "/etc/snmp/unbound" + mode: "0755" + owner: "root" + group: "root" + +- name: nameserver | snmpd | configure extend + lineinfile: + path: "/etc/snmp/snmpd.conf" + state: present + line: "extend unbound /etc/snmp/unbound" + insertafter: "# SECTION: Extends" + notify: restart_snmpd \ No newline at end of file diff --git a/roles/nameserver/tasks/install_unbound.yml b/roles/nameserver/tasks/install_unbound.yml new file mode 100644 index 0000000..cf80c65 --- /dev/null +++ b/roles/nameserver/tasks/install_unbound.yml @@ -0,0 +1,12 @@ +- name: nameserver | unbound | install packages + package: + name: "{{ unbound_package }}" + state: present + +- name: nameserver | unbound | copy config + template: + src: "unbound_network.conf.j2" + dest: "etc/unbound/unbound.conf.d/network.conf" + mode: "0644" + owner: "root" + group: "root" \ No newline at end of file diff --git a/roles/nameserver/templates/unbound_network.conf.j2 b/roles/nameserver/templates/unbound_network.conf.j2 new file mode 100644 index 0000000..0681c6b --- /dev/null +++ b/roles/nameserver/templates/unbound_network.conf.j2 @@ -0,0 +1,17 @@ +server: + ip-freebind: yes + interface: {{ wg_local_ip | ipaddr('address') }} + interface: 127.0.0.1 + interface: 127.0.0.53 + interface: ::1 + outgoing-interface: {{ ansible_default_ipv4.address }} + outgoing-interface: {{ ansible_default_ipv6.address }} + access-control: 192.168.1.0/24 allow + access-control: 192.168.3.0/24 allow + access-control: 172.16.0.0/24 allow + extended-statistics: yes + statistics-cumulative: yes + +remote-control: + control-enable: yes + control-interface: 127.0.0.1 \ No newline at end of file diff --git a/roles/nameserver/vars/Archlinux.yml b/roles/nameserver/vars/Archlinux.yml index 81ec7ed..fdc6336 100644 --- a/roles/nameserver/vars/Archlinux.yml +++ b/roles/nameserver/vars/Archlinux.yml @@ -1,2 +1,3 @@ bind_package: bind +unbound_package: unbound perl_readbackwards: perl-file-readbackwards \ No newline at end of file diff --git a/roles/nameserver/vars/Debian.yml b/roles/nameserver/vars/Debian.yml index d6b249e..be7d2f2 100644 --- a/roles/nameserver/vars/Debian.yml +++ b/roles/nameserver/vars/Debian.yml @@ -1,2 +1,3 @@ bind_package: bind9 +unbound_package: unbound perl_readbackwards: libfile-readbackwards-perl \ No newline at end of file diff --git a/roles/nameserver/vars/Ubuntu.yml b/roles/nameserver/vars/Ubuntu.yml index d6b249e..be7d2f2 100644 --- a/roles/nameserver/vars/Ubuntu.yml +++ b/roles/nameserver/vars/Ubuntu.yml @@ -1,2 +1,3 @@ bind_package: bind9 +unbound_package: unbound perl_readbackwards: libfile-readbackwards-perl \ No newline at end of file