Merge infra and k3 into one directory again

Since I don't have multiple terraform steps anymore it simply doesn't
make sense to me anymore to split all tasks into separate folders.
Instead I try to be as clear as possible in the README to make it easy
to follow the structure in the future without too much headache.
This commit is contained in:
2025-09-21 19:28:08 +02:00
parent fef383fed4
commit 7297892e18
32 changed files with 70 additions and 99 deletions

View File

@@ -0,0 +1,3 @@
dns_servers: 8.8.8.8 8.8.4.4
network_config_path: /etc/systemd/network

View File

@@ -0,0 +1,4 @@
- name: Restart resolved
service:
name: systemd-resolved
state: restarted

View File

@@ -0,0 +1,29 @@
- name: Set default network route
shell: "ip route add default via {{ private_nat }}"
ignore_errors: "yes"
when: ansible_facts['default_ipv4']['alias'] is not defined
- name: Regather facts
setup:
when: ansible_facts['default_ipv4']['alias'] is not defined
- name: Gather fact target_nic
set_fact:
target_nic: "{{ ansible_facts['default_ipv4']['alias'] }}"
- name: Ensure path to configure default route
file:
path: "{{ network_config_path }}"
state: directory
- name: Configure default route
template:
src: nic.network.j2
dest: "{{ network_config_path }}/10-{{target_nic}}.network"
- name: Configure DNS servers
lineinfile:
path: /etc/systemd/resolved.conf
regexp: '^#?\s*DNS\s*=.*'
line: "DNS={{ dns_servers }}"
notify: "Restart resolved"

View File

@@ -0,0 +1,5 @@
[Match]
Name={{ target_nic }}
[Network]
DHCP=yes
Gateway={{ private_nat }}