Compare commits
2 commits
13114e3a84
...
a1618a3092
| Author | SHA1 | Date | |
|---|---|---|---|
| a1618a3092 | |||
| 3fc19b62c8 |
6 changed files with 25 additions and 5 deletions
|
|
@ -4,3 +4,5 @@ lan_interface_mac: 00:d8:61:9f:52:65
|
|||
local_network_address: 192.168.2.15/24
|
||||
local_network_dns: 192.168.2.254
|
||||
local_network_gateway: 192.168.2.254
|
||||
|
||||
hostname: desktop
|
||||
|
|
|
|||
|
|
@ -5,3 +5,5 @@ local_network_ssid: KPNAE51C6
|
|||
local_network_address: 192.168.2.9/24
|
||||
local_network_dns: 192.168.2.254
|
||||
local_network_gateway: 192.168.2.254
|
||||
|
||||
hostname: xps
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
ansible.builtin.import_tasks: 'tasks/setup.yml'
|
||||
tags: setup
|
||||
|
||||
# TODO: add hostname provisioning
|
||||
- name: Network provisioning
|
||||
ansible.builtin.import_tasks: 'tasks/network.yml'
|
||||
tags: network
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
5
templates/hosts.j2
Normal file
5
templates/hosts.j2
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
127.0.0.1 localhost.localdomain localhost
|
||||
127.0.1.1 localhost.localdomain {{ hostname }}
|
||||
::1 localhost.localdomain localhost
|
||||
|
|
@ -10,7 +10,5 @@ DNS={{ local_network_dns }}
|
|||
Gateway={{ local_network_gateway }}
|
||||
DHCP=no
|
||||
IPv6AcceptRA=no
|
||||
RequiredForOnline=routable
|
||||
|
||||
[Link]
|
||||
MulticastDNS=yes
|
||||
RequiredForOnline=routable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue