Ask Your Question

How do I work around puppet 3 semantics change?

asked 2014-08-20 12:08:11 -0600

RobertII gravatar image

I'm starting to move a collection of puppet manifests to Puppet 3 (3.6.2), and I have fallen foul of a change in the semantics.

In our setup, each application can use a module "duplicity::backup" to get itself backed up by a host-wide duplicity service. Doing so creates an application-specific cron jobs (i.e. file in /etc/cron.d), named "${duplicity::crontabdir}/${duplicity::crontabstem}${name}". We have $duplicity_stem = "duplicity_backup, so we get files named things like "/etc/cron.d/duplicity-backup-trac".

In addition to this, our general "duplicity" module (which is requiredbyduplicity:backup uses tidy to remove any obsolete cron jobs. Specifically, it does...

 # remove any non-managed duplicity files     
 tidy {
       recurse => true,
       matches => "${crontab_stem}*";

These two play together nicely in Puppet 2.7: any files in /etc/cron.d that we put there are removed, but files with unrelated names are left alone.

But things have changed in Puppet 3.6.2, which complains that there is a dependency cycle

Error: Could not apply complete catalog: Found 1 dependency cycle:
(File[/etc/cron.d/duplicity-backup-trac] => Tidy[/etc/cron.d] => Class[Duplicity] => Duplicity::Backup[trac-backups] => File[/etc/cron.d/duplicity-backup-trac])

What is the best way to fix this? To keep the current functionality of deleting some of the unmanaged files in the directory, but not all of them?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-08-24 14:19:54 -0600

reidmv gravatar image

The two things that could be causing this are either type autorequires or explicit/default dependencies. Autorequires are highly unlikely for the relationships shown, which leaves dependencies specified either directly against the resources or else type defaults cascading down in an unexpected way. It's worth noting that the Tidy type operates by creating new file resources in the graph.

To determine specifics, it would be helpful to see the relevant Puppet code containing each of the resources mentioned in the dependency cycle. Judging by only the dependencies shown, I think the code most likely to be relevant the definition of the Duplicity::Backup defined type, followed by whatever code creates the relationship Tidy[/etc/cron.d] => Class[Duplicity].

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-08-20 12:08:11 -0600

Seen: 130 times

Last updated: Aug 24 '14