Ask Your Question
0

Require a defined resource does require apply to resources within define?

asked 2013-03-08 10:09:49 -0500

mfg36 gravatar image

I have a defined resource 'MyDefine' which includes file and exec resources.

Outside of this define I have a package resource:

package { 'blah':
  ensure => present,
  require => MyDefine['something']
}

Question is does the require for for MyDefine in package['blah'] apply to all the resources (file, exec) inside of MyDefine? I need both the file and exec inside of MyDefine to run before package 'blah' is installed.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-03-08 14:03:24 -0500

lavaman gravatar image

Yes. It will make sure that all resources in your defined type are applied before the package.

This is also true of classes:

require => Class['foo']

but, if the class or defined type includes another class, it will not order the resources in the included class. This is the reason for the anchor pattern:

http://projects.puppetlabs.com/projects/puppet/wiki/Anchor_Pattern

edit flag offensive delete link more

Comments

Thank you!

mfg36 gravatar imagemfg36 ( 2013-03-08 14:10:10 -0500 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2013-03-08 10:09:49 -0500

Seen: 313 times

Last updated: Mar 08 '13