diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2024-09-14 20:38:55 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2024-09-14 20:39:29 +0200 |
commit | 8353376b24e6f2c038575c8d378c348c4ee5e092 (patch) | |
tree | 43d205378735debeb8fe0c9a15ef5756d0348286 | |
parent | be5e42a6ce45470aff3838da034e77366b86aad9 (diff) | |
download | infra-8353376b24e6f2c038575c8d378c348c4ee5e092.tar.gz infra-8353376b24e6f2c038575c8d378c348c4ee5e092.tar.bz2 infra-8353376b24e6f2c038575c8d378c348c4ee5e092.tar.xz infra-8353376b24e6f2c038575c8d378c348c4ee5e092.zip |
systemd-networkd: Allow templating
-rw-r--r-- | ansible/plays/templates/danneri/systemd-networkd/enp1s0.netdev (renamed from ansible/plays/files/danneri/systemd-networkd/enp1s0.netdev) | 0 | ||||
-rw-r--r-- | ansible/plays/templates/danneri/systemd-networkd/enp1s0.network (renamed from ansible/plays/files/danneri/systemd-networkd/enp1s0.network) | 0 | ||||
-rw-r--r-- | ansible/roles/systemd-networkd/handlers/main.yml | 5 | ||||
-rw-r--r-- | ansible/roles/systemd-networkd/tasks/main.yml | 10 |
4 files changed, 9 insertions, 6 deletions
diff --git a/ansible/plays/files/danneri/systemd-networkd/enp1s0.netdev b/ansible/plays/templates/danneri/systemd-networkd/enp1s0.netdev index 1e0ca6a..1e0ca6a 100644 --- a/ansible/plays/files/danneri/systemd-networkd/enp1s0.netdev +++ b/ansible/plays/templates/danneri/systemd-networkd/enp1s0.netdev diff --git a/ansible/plays/files/danneri/systemd-networkd/enp1s0.network b/ansible/plays/templates/danneri/systemd-networkd/enp1s0.network index 1e0ca6a..1e0ca6a 100644 --- a/ansible/plays/files/danneri/systemd-networkd/enp1s0.network +++ b/ansible/plays/templates/danneri/systemd-networkd/enp1s0.network diff --git a/ansible/roles/systemd-networkd/handlers/main.yml b/ansible/roles/systemd-networkd/handlers/main.yml index 9656da4..5050e02 100644 --- a/ansible/roles/systemd-networkd/handlers/main.yml +++ b/ansible/roles/systemd-networkd/handlers/main.yml @@ -1,4 +1,5 @@ -- name: restart +- become: yes + name: reload systemd: name: systemd-networkd - state: restarted + state: reloaded diff --git a/ansible/roles/systemd-networkd/tasks/main.yml b/ansible/roles/systemd-networkd/tasks/main.yml index 13c167b..0e8856b 100644 --- a/ansible/roles/systemd-networkd/tasks/main.yml +++ b/ansible/roles/systemd-networkd/tasks/main.yml @@ -1,9 +1,11 @@ -- systemd: +- become: yes + systemd: name: systemd-networkd state: started enabled: yes -- loop: "{{ systemd_networkd__files | default([]) }}" - copy: +- become: yes + loop: "{{ systemd_networkd__files | default([]) }}" + template: src: "{{ item }}" dest: "/etc/systemd/network/{{ item | basename }}" - notify: restart + notify: reload |