Weird. You'd think this would be common problem number 1 in people trying to use modules with puppet...
On Fri, Oct 23, 2009 at 2:36 PM, Carl Caum <carl.c...@gmail.com> wrote: > > Interesting. That's worked for me in the past. Well outside of > creating a package resource default, you'll need to just put requires > in the classes that require other classes to be run first. Really, > that's not a bad idea at all since relationships should be explicit > if not just for readability. Remember that puppet should be your > executable documentation. > > You might be able to do something like: > > if defined(Class["yum"]) { > require yum > } > > But I've never tried that. If it works, then it will only define a > relationship if the class is actually being used. Just keep that this > will not work in 0.25 since require is broken. It will work in 0.25.1 > though. > > > On Oct 23, 2009, at 4:18 PM, Douglas Garstang wrote: > >> >> Actually, that doesn't seem to be what's happening Carl. >> >> I have this... >> >> node tst_basenode { >> >> # Do not include any modules here, other than yum, that require >> software >> # or they will fail! If you include other modules in this node >> definition, >> # there is no guarantee that yum will be completed before them. >> include yum >> >> } >> >> node tst_basenode_centos inherits tst_basenode { >> include yum-priority >> include ntp >> include ldap_client >> include syslog_ng >> } >> >> node test_node inherits tst_basenode_centos { >> include mysql_client >> include mysql_server >> } >> >> ... and I am DEFINITELY seeing puppet try and install objects from >> ldap, mysql and yum-priority BEFORE the yum module is complete. >> >> Douglas. >> >> >> On Fri, Oct 23, 2009 at 1:22 PM, Douglas Garstang >> <doug.garst...@gmail.com> wrote: >>> Awesome info. Thanks Carl! >>> >>> On Fri, Oct 23, 2009 at 1:18 PM, Carl Caum <carl.c...@gmail.com> >>> wrote: >>>> >>>> There's two ways you can go about this. >>>> >>>> 1) One dirty little secret of puppet is that inheritance is always >>>> done in order. So if you move the includes for yum and yum-priority >>>> to the node basenode_centos_5, they will processed first. I'm not >>>> sure if this is still true in 0.25 though. >>>> >>>> 2) Set up a package default in the base node. >>>> >>>> Package{ >>>> require => [ Class["yum"], Class["yum-priority"] ]; >>>> } >>>> >>>> I'm sure there's other ways to go about this, so other feel free to >>>> pitch in :) >>>> >>>> On Oct 23, 2009, at 3:12 PM, Douglas Garstang wrote: >>>> >>>>> >>>>> I have this... >>>>> >>>>> node test_node inherits basenode_centos_5 { >>>>> include yum >>>>> include yum-priority >>>>> include mysql_client >>>>> include mysql_server >>>>> } >>>>> >>>>> Puppet seems to be executing stuff from the mysql_client and >>>>> mysql_server modules before the yum module. I had assumed that >>>>> modules >>>>> were executed in the order that they where included, but this seems >>>>> not to be the case. I guess you could use requires() all over the >>>>> place in the mysql modules to make sure that yum had completed >>>>> doing >>>>> it's thing first, but that seems horribly complicated to me. Is >>>>> there >>>>> a better way? Since having your yum repositories is critical to >>>>> software being installed, it should always be done first. >>>>> >>>>> Please don't tell me I have to do it with requires.... :( That >>>>> would >>>>> mean EVERY package() statement would need a requires => class >>>>> ['yum'], >>>>> right? >>>>> >>>>> Doug. >>>>> >>>>>> >>>> >>>> >>>>>> >>>> >>> >>> >>> >>> -- >>> Regards, >>> >>> Douglas Garstang >>> http://www.linkedin.com/in/garstang >>> Email: doug.garst...@gmail.com >>> Cell: +1-805-340-5627 >>> >> >> >> >> -- >> Regards, >> >> Douglas Garstang >> http://www.linkedin.com/in/garstang >> Email: doug.garst...@gmail.com >> Cell: +1-805-340-5627 >> >> > > > > > > -- Regards, Douglas Garstang http://www.linkedin.com/in/garstang Email: doug.garst...@gmail.com Cell: +1-805-340-5627 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---