Only restart non-networkd services when the role is configured to install them

The variable systemd_networkd_distro_packages can be overridden
externally to be an empty list, to ensure the minimum number of
tasks executes in this role. This might happen when the target
is know to already have the pre-requisite packages present because
they have been built into a container or VM image previously.

This patch adjusts the non-networkd service start handler to only
run when the distro package list is not empty.

Change-Id: I6bfb5b66dfef090e3de0d90f726a06e290c09bc0
This commit is contained in:
Jonathan Rosser 2025-01-20 14:24:26 +00:00
parent b9554b1e7f
commit 974a105e92

View File

@ -23,6 +23,8 @@
- dbus
- systemd-udevd
listen: Restart systemd-networkd
when:
- systemd_networkd_distro_packages | length > 0
- name: Restart networkd
systemd: