hello,

----- "Douglas Garstang" <doug.garst...@gmail.com> wrote:

> Is it really this complicated? Follow my logic here...
> 
> In my scenario, it's critical that my yum repositories get installed
> by puppet to /etc/yum.repos.d first before anything else happens.
> After this, the yum-priorities rpm must be installed with yum,
> followed by ldap, since the installation of ldap MUST be complete and
> the nscd service started before anything else gets done.
> 


Unfortunately this is pretty hard, there's been many requests for a way to 
forceably hook something into the beginning of the process but so far there 
isnt a good way.  There's a ticket you can go and voice your support for the 
feature requests there.

I'm thinking you can do what you want by being careful about how you compose 
your classes - quite hard if you're just starting out though - but really if 
you need several different types of resource to execute before all other types 
of resources you're going to be hard pressed to get this done without 
decoupling things.

I have this problem too and took care of it this way:

- create an environment that sets up JUST the stuff i need done first with 
putting down a cfg file to put the machine in the final environment as last 
step, call it bootstrap - this environment has only node default and nothing 
else.
- arrange for kickstart to put down a cfg file that puts all machines into 
bootstrap

So now you'll run your node the first time, it will get yum repos setup, ldap 
installed and finally if both of those worked it will get a cfg file.  With 
just these 3 tasks forcing the dependencies isn't hard:

Class[yum::config] - create your config files u need for yum
Class[yum::repos] - include all your yum repo resources, requires yum::config

Class[ldap::install] - installs the ldap package - requires yum::repos
Class[ldap::config] - configures ldap, requires ldap::install

Class["bootstrap"] - includes all the above

File[/etc/puppet/puppet.conf] - requires Class["bootstrap"]

Your default node would then just do:

include bootstrap
file{"/etc/puppet/puppet.conf":
   source => ....
   require => Class["boostrap"]
}

With this if any of the yum config, ldap config etc fails the puppet.conf wont 
be put down and your machine will stay in bootstrap, even if your requires are 
wrong after 2 or so runs it will sort itself out

Future runs will get your normal manifests which should include yum repos, yum 
and ldap but then the ordering is less important since being first is only 
crucial the first time - subsequent times matter less.  

Other things you can do:

- tag all your classes/resources with a tag and use the --tags option to run 
those, maybe easier than the environment
- wrap your package calls in a define that has requires on the resources it 
creates, use that for all your package calls that way you do not need to 
specify require => on each one
- create a small little bootstrap manifest that you put on the machine during 
kickstart, call this using the 'puppet' executable and not via the master where 
the bulk of your manifests will come in

You can read about classes dependencies here: 
http://www.devco.net/archives/2009/09/28/simple_puppet_module_structure.php and 
about using 'puppet' rather than puppetd here 
http://www.devco.net/archives/2009/08/19/tips_and_tricks_for_puppet_debugging.php

-- 
R.I.Pienaar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to