Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a dependency loop in my Puppet install I need assistance resolving.

I have a Puppet server which updates the /etc/puppet/puppet_client.conf file. This is deployed via an erb template. The template includes setting the 'pluginsync=true' option.

I am also using a custom fact in a different template. These two (and a dozen more) are all applied as part of my core Linux template.

On a newly added server I receive a failure for a non existent fact and the execution ceases before the change to the puppet config is made. If I manually add the pluginsync option everything is kosher.

How can I address this within Puppet? Is there any way to force this, dependencies, etc?

share|improve this question
add comment

1 Answer

up vote 10 down vote accepted

I think your three options are these:

  1. Configure Puppet before running: normally you'd edit or install a puppet.conf file as part of your OS installation (kickstart %post etc), enabling the bare minimum options you need for the Puppet run to function. This would be pluginsync, server address and environment perhaps. Puppet can fully manage the file later as part of the run.
  2. Bootstrap environment: use a special environment (docs) for the bootstrapping process that configures the Puppet client only (enabling pluginsync). As part of this, set the environment in puppet.conf to point back to the normal production environment.
  3. Handle missing facts: in Puppet ERB templates you can check if a variable is present with has_variable?('foo'), so you could test it and otherwise use a default, e.g. <%= has_variable?('foo') ? foo : 'default value' %>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.