Puppet execution classes order

Hi,

I would like to know a way to specify the execution order of puppet classes
in foreman.

For example: I have a personalized apache deb package in my own repository,
wich is configured with the puppet class "apt::xx". If the class
"apache:xx" is executed before the class "apt:xx" it report errors because
my repositories are not established yet and the personal apache package is
not installed. The ideal situation in my case is to specify that the class
that is going to be executed first always is "apt::xx".

In foreman I think puppet classes are only sorted alphabetically and it
doesn´t matter this order in terms of execution.

Maybe an option could the run stages in puppet but I´m not sure:

You'll need to edit the code of your modules. Foreman is just an external
node classifier
so it just assigns the classes to the nodes. Puppet is a
declaritive language so it too will initstantiate the modules in a somewhat
arbitrary order, but it has a few features to declare dependencies. Take a
look at this link.

··· On Friday, June 28, 2013 5:19:52 AM UTC-4, Félix Barbeira wrote: > > Hi, > > I would like to know a way to specify the execution order of puppet > classes in foreman. > > For example: I have a personalized apache deb package in my own > repository, wich is configured with the puppet class "apt::xx". If the > class "apache:xx" is executed before the class "apt:xx" it report errors > because my repositories are not established yet and the personal apache > package is not installed. The ideal situation in my case is to specify that > the class that is going to be executed first always is "apt::xx". > > In foreman I think puppet classes are only sorted alphabetically and it > doesn´t matter this order in terms of execution. > > Maybe an option could the run stages in puppet but I´m not sure: > > http://docs.puppetlabs.com/puppet/3/reference/lang_run_stages.html >

Thanks Lucas!!

I didn´t notice that I was able to specify a Class in the "require"
section. I solved the issue with the following code:

package { 'apache-custom' :
ensure => installed,
require => Class['apt::custom'],
}

··· El viernes, 28 de junio de 2013 16:49:25 UTC+2, Lucas Yamanishi escribió: > > You'll need to edit the code of your modules. Foreman is just an > *external node classifier* so it just assigns the classes to the nodes. > Puppet is a declaritive language so it too will initstantiate the modules > in a somewhat arbitrary order, but it has a few features to declare > dependencies. Take a look at this [link]( > http://docs.puppetlabs.com/learning/ordering.html). > > On Friday, June 28, 2013 5:19:52 AM UTC-4, Félix Barbeira wrote: >> >> Hi, >> >> I would like to know a way to specify the execution order of puppet >> classes in foreman. >> >> For example: I have a personalized apache deb package in my own >> repository, wich is configured with the puppet class "apt::xx". If the >> class "apache:xx" is executed before the class "apt:xx" it report errors >> because my repositories are not established yet and the personal apache >> package is not installed. The ideal situation in my case is to specify that >> the class that is going to be executed first always is "apt::xx". >> >> In foreman I think puppet classes are only sorted alphabetically and it >> doesn´t matter this order in terms of execution. >> >> Maybe an option could the run stages in puppet but I´m not sure: >> >> http://docs.puppetlabs.com/puppet/3/reference/lang_run_stages.html >> >