Add hostname provisioning
This commit is contained in:
parent
3fc19b62c8
commit
a1618a3092
5 changed files with 24 additions and 2 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue