CiscoSystems/puppet-cobbler — pull request #41 by bodepd (2013-06-18 04:47:22+00:00)
Title: Add a sleep to cobbler start.

The previous cobbler code was only working by accident.

The cobbler service takes a little bit of time to be
able to service requests after being restarted/started.
Previously, things only appeared to work b/c a package
happened to install in between the management of the
cobbler service and the invocation of calls that actually use it.

I ran into issues when I added additional resources
to the catalog (when I updated to use the new puppet
module)

With these additional resources, another cobbler sync
was being called immediately after the service was started.
This resulted in the error:

Exec[cobbler-sync]/returns: cobblerd does not appear to be running/accessible

The underlying problem can be simply recreated with:

/sbin/restart cobbler;cobbler syhc

This patch adds an additional sleep of 1 second to the start command.

I have verified that 1 second is consistently enough time for the
service to be able to accept request when the resource finishes
evaluating.