diff options
-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: |