Add hostname provisioning

This commit is contained in:
Sonny Bakker 2025-04-12 21:34:32 +02:00
parent 3fc19b62c8
commit a1618a3092
5 changed files with 24 additions and 2 deletions

View file

@ -3,11 +3,25 @@
# 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: "{{ lookup('ansible.builtin.first_found', paths) }}"
dest: '/etc/nftables.conf'
dest: /etc/nftables.conf
owner: root
group: root
mode: '0600'