Comment 48 for bug 1570472

Revision history for this message
Dmitry Teselkin (teselkin-d) wrote :

@nacc, I've tested puppet 3.8 from your ppa, and found one issue with it. It looks like 'defaultfor' works well only when it compares values for facts.
:exists doesn't look like a fact, and defaultfor works incorrectly. I fixed it by adding fact :runs_on_systemd and testing its value instead, see attached patch.

Don't know if it applicable for puppet 4.5 though.

Without the patch

# puppet apply -dv --execute 'service{cron:}'
...
Info: Applying configuration version '1469565569'
Debug: Executing '/usr/sbin/service cron status'
Debug: Finishing transaction 30515820
Debug: Storing state
Debug: Stored state in 0.51 seconds
Notice: Finished catalog run in 1.09 seconds
...

With patch applied

# puppet apply -dv --execute 'service{cron:}'
...
Info: Applying configuration version '1469565628'
Debug: Executing '/bin/systemctl is-active cron'
Debug: Finishing transaction 33627360
Debug: Storing state
Debug: Stored state in 0.45 seconds
Notice: Finished catalog run in 1.11 seconds
...

I use Ubuntu 16.04.1, no upstart installed.