Compare commits
No commits in common. "94dfe36c465a7984a6180a53c38f40c26d91aeea" and "c79c445a234efaf54b763575c20446b324898c6e" have entirely different histories.
94dfe36c46
...
c79c445a23
@ -22,9 +22,3 @@
|
|||||||
name: wget
|
name: wget
|
||||||
state: present
|
state: present
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Install dig utility
|
|
||||||
package:
|
|
||||||
name: "{{ (ansible_facts['os_family'] == 'Archlinux') | ternary('bind', 'dnsutils') }}"
|
|
||||||
state: present
|
|
||||||
changed_when: false
|
|
||||||
|
|||||||
@ -107,17 +107,10 @@
|
|||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /tmp/hosts.txt
|
path: /tmp/hosts.txt
|
||||||
state: absent
|
state: absent
|
||||||
- name: Check if root.key exists
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "{{ unbound_anchor_root_key }}"
|
|
||||||
register: root_key_stat
|
|
||||||
|
|
||||||
- name: Initialize dnssec trust anchor if missing
|
- name: Initialize dnssec trust anchor if missing
|
||||||
ansible.builtin.command: unbound-anchor -a {{ unbound_anchor_root_key }}
|
ansible.builtin.command: unbound-anchor -a {{ unbound_anchor_root_key }}
|
||||||
when: not root_key_stat.stat.exists
|
args:
|
||||||
register: unbound_anchor_result
|
creates: "{{ unbound_anchor_root_key }}"
|
||||||
failed_when: unbound_anchor_result.rc != 0 and unbound_anchor_result.rc != 1
|
|
||||||
changed_when: unbound_anchor_result.rc == 0
|
|
||||||
|
|
||||||
- name: Ensure root.key has correct ownership and permissions
|
- name: Ensure root.key has correct ownership and permissions
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|||||||
@ -2,13 +2,11 @@
|
|||||||
view:
|
view:
|
||||||
name: "vpn"
|
name: "vpn"
|
||||||
view-first: yes
|
view-first: yes
|
||||||
{% if unbound_custom_vpn_records is defined %}
|
|
||||||
{% for host, ips in unbound_custom_vpn_records.items() %}
|
{% for host, ips in unbound_custom_vpn_records.items() %}
|
||||||
local-data: "{{ host }}. IN A {{ ips.v4 }}"
|
local-data: "{{ host }}. IN A {{ ips.v4 }}"
|
||||||
{% if ips.v6 is defined %}
|
{% if ips.v6 is defined %}
|
||||||
local-data: "{{ host }}. IN AAAA {{ ips.v6 }}"
|
local-data: "{{ host }}. IN AAAA {{ ips.v6 }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
include: "{{ unbound_ad_servers_config_path }}"
|
include: "{{ unbound_ad_servers_config_path }}"
|
||||||
|
|||||||
@ -12,8 +12,7 @@ server:
|
|||||||
ip-freebind: yes
|
ip-freebind: yes
|
||||||
|
|
||||||
# Define interface binds by IP address
|
# Define interface binds by IP address
|
||||||
interface: 127.0.0.1 # lo (IPv4)
|
interface: 127.0.0.1 # lo
|
||||||
interface: ::1 # lo (IPv6)
|
|
||||||
interface: {{ unbound_interface_lan }} # lan0
|
interface: {{ unbound_interface_lan }} # lan0
|
||||||
interface: {{ unbound_interface_vpn }} # wg0
|
interface: {{ unbound_interface_vpn }} # wg0
|
||||||
|
|
||||||
@ -96,7 +95,6 @@ server:
|
|||||||
|
|
||||||
# Ensure kernel buffer is large enough to not lose messages in traffic spikes
|
# Ensure kernel buffer is large enough to not lose messages in traffic spikes
|
||||||
so-rcvbuf: 1m
|
so-rcvbuf: 1m
|
||||||
so-sndbuf: 0
|
|
||||||
|
|
||||||
# Ensure privacy of local IP ranges
|
# Ensure privacy of local IP ranges
|
||||||
private-address: 192.168.0.0/16
|
private-address: 192.168.0.0/16
|
||||||
|
|||||||
@ -4,6 +4,6 @@ wireguard_port: 51820 # static port to receive input connections
|
|||||||
wireguard_server_mode: true # enables NAT and open port
|
wireguard_server_mode: true # enables NAT and open port
|
||||||
wireguard_interface: wg0
|
wireguard_interface: wg0
|
||||||
wireguard_config_base_path: /etc/wireguard
|
wireguard_config_base_path: /etc/wireguard
|
||||||
# wireguard_address: 192.168.27.1/27 # Intentionally undefined - role will fail if not set
|
wireguard_address: 192.168.27.1/27
|
||||||
# wireguard_dns: 192.168.27.1 # Intentionally undefined - role will fail if not set
|
wireguard_dns: 192.168.27.1
|
||||||
wireguard_peers: []
|
wireguard_peers: []
|
||||||
|
|||||||
@ -1,16 +1,4 @@
|
|||||||
---
|
---
|
||||||
- name: Validate required variables are set
|
|
||||||
ansible.builtin.assert:
|
|
||||||
that:
|
|
||||||
- wireguard_address is defined
|
|
||||||
- wireguard_address | length > 0
|
|
||||||
- wireguard_dns is defined
|
|
||||||
- wireguard_dns | length > 0
|
|
||||||
fail_msg: |
|
|
||||||
wireguard_address and wireguard_dns are required.
|
|
||||||
See roles/wireguard/defaults/main.yml for configuration instructions.
|
|
||||||
success_msg: "Variable validation passed"
|
|
||||||
|
|
||||||
- name: Install wireguard
|
- name: Install wireguard
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: "{{ (ansible_facts['os_family'] == 'Archlinux') | ternary('wireguard-tools', 'wireguard') }}"
|
name: "{{ (ansible_facts['os_family'] == 'Archlinux') | ternary('wireguard-tools', 'wireguard') }}"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user