razorsedge/puppet-vmwaretools — pull request #7 by rcoleman (2012-10-22 23:21:22+00:00)
Title: Refactor ntp class for proper timesync behavior

Prior to this commit, the vmwaretools::ntp class was a complete noop
because the exec was marked as refreshonly with no refresh event
(notify or subscribe) affecting it.

Additionally, the refresh event was reliant on package installation
or upgrades which isn't very idempotent. Ideally, each time Puppet
runs, the timesync status should be evaluated and corrected if needed.

Unfortunately, after a few hours of experimentation, I was unable to
create a proper way of determining timesync status using the
vmware-guestd tooling. As a result, I had to split the class into two
exec resources for the different desired behaviors.

If the service_pattern is vmtoolsd, timesync will disable if the status
exec returns 0, which happens when timesync is enabled. However, if the
service_pattern is vmware-guestd, the previous exec is maintained but
the package require is replaced by a subscribe. If the service_pattern
isn't matched, the class does nothing as it did previously.