Closed shieldwed closed 4 months ago
I am quite uncertain on how to test these changes. Especially since tests for absence of certain relationships seem to be asked for in this case.
This probably impossible to test due to rspec-puppet having different transitive dependencies than real Puppet ...
I've implemented some tests for the changed cases. Can you please look at them again?
@ekohl can you please have another look at this PR? Thank you
Can someone please have a look at this again (e.g. @bastelfreak or @TheMeier perhaps)? Thank you.
Pull Request (PR) description
Since multiple drop-in files of the same unit notify the same
Systemd::Daemon_reload
resource, changing a drop in file withoutnotify_service
still triggers a service refresh if at least one other drop-in file hasnotify_service
set (default) regardless of it being changed.Therefore, the
Systemd::Daemon_reload
should only be ordered before theService
but not notify it. Theservice
will already be refreshed if the drop-in file changes andnotify_service
is set (default).This Pull Request (PR) addresses the following issues
Consider the following Puppet code snippet with two drop-in files for the service
nginx.service
:On the first Puppet-run, this code will correctly refresh the service, as the
ulimit.conf
-file will be written. Once the drop-in files are in sync with this configuration, no more SystemD daemon reloads and service refreshes happen.Now, changing the
Restart
configuration ofnginx.service
doesn't need the service itself to be restarted.However, due to the second drop-in file specifying
notify_service => true
(default), this will lead toSystemd::Daemon_reload[$unit]
being triggered (expected due todaemon_reload => true
(default)), which then in turn triggersService[nginx.service]
andService[nginx]
if they exist.