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