It's not clear to me why the autorequire was added to the Tidy resource
type, and in fact I am having trouble even locating it in the Puppet code.
I suppose the objective is probably to deal with recursively tidying
directories that are wholly or partially managed via recursive File
resources, as such Files may also add resources to the catalog, and you
(presumably) want the Tidy to defer to the File in such cases.
Ideally, you would move the Tidy (and all others) someplace that would
cause it to be applied in the last run stage. If it is applied any time
sooner then you risk a cycle. For instance, perhaps you could add a
declaration of class crond::cleanup with an explicit assignment to
Stage['post'], some place where it will be evaluated before any of the
cron::job declarations. Or if you're using Hiera, you may be able to just
put
crond::cleanup::stage: "Stage['post']"
in your data.
Alternatively, you should be able to overcome any autorequire by declaring
a contradictory explicit relationship. For example, you could try this:
define crond::job($jobs,$comment,$mail="root") {
include crond::cleanup
file {
"/etc/cron.d/${name}.puppet.cron":
owner=>root,group=>root,
content=>template("crond/job.erb")
} <- Tidy['/etc/cron.d']
}
In that case, however, do check carefully to be sure that the Tidy is not
removing any files you want to retain.
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/9ded7453-1e58-4c44-b92e-08932be3e0fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.