arch-setup/tasks/network/main.yml
Sonny Bakker 970f7489fb Layout refactor
Also included provisioning for htpc host
2025-10-12 15:33:37 +02:00

28 lines
750 B
YAML

# Note that Wireguard does DNS resolution only once during connection.
# When a client's IP changes, the server should be notified in some way,
# using `wg set wg0 peer izHzmRwh2yzICps6pFI2Bg3TnmTD66/8uH4loJpkuD4= endpoint <NEW-IP>:<PORT>`
# for example.
- name: Set hostname
become: true
ansible.builtin.hostname:
name: '{{ hostname }}'
use: systemd
- name: Copy hosts file
become: true
ansible.builtin.template:
src: templates/hosts.j2
dest: /etc/hosts
mode: '0644'
owner: root
- name: Copy firewall template
become: true
ansible.builtin.template:
src: 'templates/{{ ansible_hostname }}/nftables.j2'
dest: /etc/nftables.conf
owner: root
group: root
mode: '0600'
notify: restart nftables