Compare commits

..

4 commits

4 changed files with 9 additions and 11 deletions

View file

@ -1,6 +1,6 @@
--- ---
network_interface: link1 network_interface: link1
network_mac: 00:1b:21:3b:50:e2 network_pci_path: pci-0000:04:00.0
lan_ip: 192.168.2.1 lan_ip: 192.168.2.1
lan_gateway: 192.168.2.254 lan_gateway: 192.168.2.254

View file

@ -14,8 +14,8 @@
- src: "templates/network/link1.network.j2" - src: "templates/network/link1.network.j2"
dest: "/etc/systemd/network/98-link1.network" dest: "/etc/systemd/network/98-link1.network"
notify: notify:
- restart systemd-networkd - Restart systemd-networkd
- regenerate initramfs # copies the files into the initramfs for when udev needs them - Regenerate initramfs # copies the files into the initramfs for when udev needs them
- name: Set hostname - name: Set hostname
become: true become: true
@ -38,7 +38,7 @@
dest: "/etc/systemd/resolved.conf" dest: "/etc/systemd/resolved.conf"
mode: "0644" mode: "0644"
owner: root owner: root
notify: restart systemd-resolved notify: Restart systemd-resolved
- name: Copy firewall template - name: Copy firewall template
become: true become: true
@ -49,5 +49,5 @@
group: root group: root
mode: "0644" mode: "0644"
notify: notify:
- restart nftables - Restart nftables
- restart docker service - Restart docker service

View file

@ -1,8 +1,9 @@
# {{ ansible_managed }} # {{ ansible_managed }}
[Match] [Match]
MACAddress={{ network_mac }} Path={{ network_pci_path }}
[Link] [Link]
NamePolicy= NamePolicy=
Name={{ network_interface }} Name={{ network_interface }}
RequiredForOnline=routable

View file

@ -4,12 +4,9 @@
Name={{ network_interface }} Name={{ network_interface }}
[Network] [Network]
Address={{ lan_ip }}/{{ lan_prefix }}
Gateway={{ lan_gateway }}
DNS={{ lan_dns }} DNS={{ lan_dns }}
DNSOverTLS=yes DNSOverTLS=yes
DNSSEC=yes DNSSEC=yes
DHCP=ipv4
RequiredForOnline=routable
IgnoreCarrierLoss=yes IgnoreCarrierLoss=yes