Ask Your Question

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

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:

edit flag offensive delete link more


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


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

Seen: 285 times

Last updated: Mar 08 '13