diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2024-09-17 20:53:53 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2024-09-17 20:53:53 +0200 |
commit | 7ad2c810f6743a12a75ada1751bd098960db6846 (patch) | |
tree | a4749ca406b634e68b53c19f88536d9e581abb15 | |
parent | 0ce711ed34b46940edc970e1d20a38218347c463 (diff) | |
download | infra-7ad2c810f6743a12a75ada1751bd098960db6846.tar.gz infra-7ad2c810f6743a12a75ada1751bd098960db6846.tar.bz2 infra-7ad2c810f6743a12a75ada1751bd098960db6846.tar.xz infra-7ad2c810f6743a12a75ada1751bd098960db6846.zip |
danneri
-rw-r--r-- | ansible/host_vars/danneri/systemd-networkd.yml | 3 | ||||
-rw-r--r-- | ansible/inventory | 2 | ||||
-rw-r--r-- | ansible/plays/danneri.yml | 13 | ||||
-rw-r--r-- | ansible/plays/files/danneri/systemd-networkd/enp1s0.network | 6 | ||||
-rw-r--r-- | ansible/roles/systemd-networkd/handlers/main.yml | 4 | ||||
-rw-r--r-- | ansible/roles/systemd-networkd/tasks/main.yml | 7 |
6 files changed, 30 insertions, 5 deletions
diff --git a/ansible/host_vars/danneri/systemd-networkd.yml b/ansible/host_vars/danneri/systemd-networkd.yml index 842a42e..023e276 100644 --- a/ansible/host_vars/danneri/systemd-networkd.yml +++ b/ansible/host_vars/danneri/systemd-networkd.yml @@ -1,3 +1,2 @@ systemd_networkd__files: - - systemd_networkd/enp1s0.netdev - - systemd_networkd/enp1s0.network + - danneri/systemd-networkd/enp1s0.network diff --git a/ansible/inventory b/ansible/inventory index a21cbc9..845580f 100644 --- a/ansible/inventory +++ b/ansible/inventory @@ -46,6 +46,8 @@ all: kv24ix: coregonus: ansible_host: 192.168.10.190 + danneri: + ansible_host: 192.168.100.103 node1: ansible_host: 9859f51e-1e3e-4c05-a826-b7fbe18d91be.pub.instances.scw.cloud diff --git a/ansible/plays/danneri.yml b/ansible/plays/danneri.yml index 47872c0..2e960ee 100644 --- a/ansible/plays/danneri.yml +++ b/ansible/plays/danneri.yml @@ -1,3 +1,14 @@ - hosts: - danneri - roles: systemd-networkd + tasks: + - import_role: + name: systemd-networkd + + - meta: flush_handlers + + - become: yes + apt: + name: + - etckeeper + - import_role: + name: timezone diff --git a/ansible/plays/files/danneri/systemd-networkd/enp1s0.network b/ansible/plays/files/danneri/systemd-networkd/enp1s0.network new file mode 100644 index 0000000..7e12c2e --- /dev/null +++ b/ansible/plays/files/danneri/systemd-networkd/enp1s0.network @@ -0,0 +1,6 @@ +[Match] +Name=enp1s0 + +[Network] +DHCP=yes +IPv6AcceptRA=true diff --git a/ansible/roles/systemd-networkd/handlers/main.yml b/ansible/roles/systemd-networkd/handlers/main.yml index 5050e02..c9b2603 100644 --- a/ansible/roles/systemd-networkd/handlers/main.yml +++ b/ansible/roles/systemd-networkd/handlers/main.yml @@ -1,5 +1,5 @@ -- become: yes - name: reload +- name: reload + become: yes systemd: name: systemd-networkd state: reloaded diff --git a/ansible/roles/systemd-networkd/tasks/main.yml b/ansible/roles/systemd-networkd/tasks/main.yml index 0e8856b..aed4168 100644 --- a/ansible/roles/systemd-networkd/tasks/main.yml +++ b/ansible/roles/systemd-networkd/tasks/main.yml @@ -3,6 +3,13 @@ name: systemd-networkd state: started enabled: yes +- name: mkdir /etc/systemd/network + become: yes + file: + path: "/etc/systemd/network" + state: directory + owner: systemd-network + group: systemd-network - become: yes loop: "{{ systemd_networkd__files | default([]) }}" template: |