| Hello, To find changed unit-files use:
$ systemctl --all status *.service 2>&1 | grep --color 'changed on disk. Run' Warning: The unit file, source configuration file or drop-ins of example.service changed on disk. Run 'systemctl daemon-reload' to reload units.
For a distinct service, it would be
$ systemctl --all status example.service 2>&1 | grep --color 'changed on disk. Run' && echo changed
BTW: `systemctl daemon-reload´ mends all deltas. Therefore I suggest, you use a trigger to a global Exec['/bin/systemctl daemon-reload'] for all changes and a `ensure => Exec['/bin/systemctl daemon-reload']´ within the Service statement. The statement {{exec['/bin/systemctl daemon-reload'] {refreshonly => true,} }} should be part of modules/systemd/manifest/init.pp. Example:
file { '/usr/lib/systemd/system/foo.service': ensure => file, owner => 'root', group => 'root', mode => '0644', source => "puppet:///modules/${module_name}/foo.service", notify => Exec['/bin/systemctl daemon-reload'], } ~> service
Unknown macro: {'foo'}
Just have a look at https://github.com/justin8/justin8-systemd Regards Andreas |