Skip to content
Snippets Groups Projects
Commit f4be1ed2 authored by Tobias Jungel's avatar Tobias Jungel
Browse files

fix(networkd): use networkctl to reload config changes

parent 6fb14d58
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,8 @@ systemd:
PollIntervalMaxSec: 2048
networkd:
# networkctl reload is available since systemd 244
networkctl_reload: false
pkg: {}
path: /etc/systemd/network
service: systemd-networkd
......
......@@ -5,8 +5,10 @@
{%- set networkd = systemd.get('networkd', {}) %}
{%- set profiles = networkd.get('profiles', {}) %}
{%- if networkd.networkctl_reload %}
include:
- systemd.reload
- systemd.networkd.reload
{%- endif %}
{% if profiles is mapping %}
{% for networkdprofile, types in profiles.items() %}
......@@ -23,8 +25,10 @@ include:
- dir_mode: 755
- context:
config: {{ profileconfig|json }}
{%- if networkd.networkctl_reload %}
- watch_in:
- cmd: reload_systemd_configuration
{% endfor %}
{% endfor %}
{% endif %}
- cmd: systemd-networkd-reload-cmd-wait
{%- endif %}
{%- endfor %}
{%- endfor %}
{%- endif %}
include:
- systemd.networkd
systemd-networkd-reload-cmd-wait:
cmd.wait:
- name: networkctl reload
- runas: root
- require:
- service: networkd
......@@ -14,6 +14,7 @@ Fedora:
pkgs_extra:
- python3-systemd
networkd:
networkctl_reload: true
pkg: {}
resolved:
pkg: {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment