Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a class in puppet if I have the following code:

class A {
  require B


I get circular dependencies error. If I have:

class A {
  include B


everything works fine

share|improve this question
up vote 14 down vote accepted

They are very different things, actually. To say require B means A must come before B (and, therefore, can lead to circular dependencies if something in B turns out to require A). And if B is not included at all, it will lead to missing dependencies error.

On the other hand, include B just says B will be applied whenever A gets applied: it says nothing of the order between them.

share|improve this answer

This was just asked (and answered) on the puppet mailing list:

The difference is evident when the catalog needs to be applied. With include you have evaluated its contents at the time of the include - but any resources must be depended on explicitly after the include. With a require - the dependency is created for you - but you have to be careful and ensure that this is your desired result

- Ken Barber in Require vs Include?

share|improve this answer

Your Answer


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.