All, I''ve been putting a lot of puppet pieces together over the last few days, and I''ve realised, I think, that you _REALLY_ need to be explicit with your object dependancies. It looks like puppet just drags all modules, all nodes, and everything else into one giant namespace and executes them in NO PARTICULAR ORDER on the target. I see examples on the puppet recipies page that probably won''t work most of the time since puppet executes things in an apparently random order. For example, the LDAP example at http://reductivelabs.com/trac/puppet/wiki/Recipes/LDAPClientNSSwitch makes no mention of the fact that the ldap.conf file needs to be updated BEFORE the service is started by putting a before=> on the file, or a require=> on the package. Or... am I just missing something here? Doug --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Douglas, You do need to be explicit with dependencies between resources; it''s a declarative system. You tell puppet what each resource needs, and it does all the work. I''ve found that it''s easy to kid yourself that you''ve gotten your manifest right, but things only work because dependencies are there from a previous run. I prefer this to the approach of cfengine, where you had to declare a fixed order for types in an action sequence (files, then exec). Best Julian. 2009/10/24 Douglas Garstang <doug.garstang@gmail.com>:> > All, > > I''ve been putting a lot of puppet pieces together over the last few > days, and I''ve realised, I think, that you _REALLY_ need to be > explicit with your object dependancies. It looks like puppet just > drags all modules, all nodes, and everything else into one giant > namespace and executes them in NO PARTICULAR ORDER on the target. > > I see examples on the puppet recipies page that probably won''t work > most of the time since puppet executes things in an apparently random > order. For example, the LDAP example at > http://reductivelabs.com/trac/puppet/wiki/Recipes/LDAPClientNSSwitch > makes no mention of the fact that the ldap.conf file needs to be > updated BEFORE the service is started by putting a before=> on the > file, or a require=> on the package. > > Or... am I just missing something here? > > Doug > > > >-- Julian Simpson Software Build and Deployment http://www.build-doctor.com --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Sat, Oct 24, 2009 at 12:42 AM, Douglas Garstang <doug.garstang@gmail.com> wrote:> I''ve been putting a lot of puppet pieces together over the last few > days, and I''ve realised, I think, that you _REALLY_ need to be > explicit with your object dependancies. It looks like puppet just > drags all modules, all nodes, and everything else into one giant > namespace and executes them in NO PARTICULAR ORDER on the target.That is correct, and while it may seem counter-intuitive, this is really a feature.> I see examples on the puppet recipies page that probably won''t work > most of the time since puppet executes things in an apparently random > order. For example, the LDAP example at > http://reductivelabs.com/trac/puppet/wiki/Recipes/LDAPClientNSSwitch > makes no mention of the fact that the ldap.conf file needs to be > updated BEFORE the service is started by putting a before=> on the > file, or a require=> on the package.What service? That manifest doesn''t declare any service resources.> Or... am I just missing something here?Many Puppet newcomers are startled by this behavior. Some were so startled they went off to join another project. Over time, I''ve learned to love this behavior, it means my manifests a) *fully* document the setup of a particular configuration and b) Always work, even if someone refactors things and reorders the declarations in the file. This is very important in a setting where multiple sysadmins are working on the same manifests. Regards, Paul --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
>> Or... am I just missing something here? > > Many Puppet newcomers are startled by this behavior. Some were so > startled they went off to join another project. Over time, I''ve > learned to love this behavior, it means my manifests a) *fully* > document the setup of a particular configuration and b) Always work, > even if someone refactors things and reorders the declarations in the > file. This is very important in a setting where multiple sysadmins are > working on the same manifests.+10000000 if you need order, declare it otherwise ordering it shouldn''t matter. cheers pete --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
2009/10/25 Peter Meier <peter.meier@immerda.ch>:> > +10000000 > > if you need order, declare it otherwise ordering it shouldn''t matter. >Pete I think that''s the best way I''ve heard that described - I will be stealing that line to use repeatedly when people ask that question. SysAdmins declare intent and do - they don''t hope things will randomly work out for them. If we did that we''d be developers... *ducks* :) Regards James Turnbull -- Author of: * Pro Linux System Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Yes, but HOW do I order it? What is the best way to do it? I assumed that modules were implemented in the order they are included, which turned out to be wrong. Someone suggested that the node hierarchy determined the order, and that didn''t work for me. I tried putting a global Paclage{} statement in my base node that required my yum repos, and that partly did it, but still installed yum-priorities way later on. I tried putting a requires => Class[''yum-priorities''] in my base class and puppet complained about module looping! On Sat, Oct 24, 2009 at 5:00 PM, James Turnbull <james@lovedthanlost.net> wrote:> > 2009/10/25 Peter Meier <peter.meier@immerda.ch>: >> >> +10000000 >> >> if you need order, declare it otherwise ordering it shouldn''t matter. >> > > Pete > > I think that''s the best way I''ve heard that described - I will be > stealing that line to use repeatedly when people ask that question. > > SysAdmins declare intent and do - they don''t hope things will randomly > work out for them. If we did that we''d be developers... *ducks* :) > > Regards > > James Turnbull > > -- > Author of: > * Pro Linux System Administration (http://tinyurl.com/linuxadmin) > * Pulling Strings with Puppet (http://tinyurl.com/pupbook) > * Pro Nagios 2.0 (http://tinyurl.com/pronagios) > * Hardening Linux (http://tinyurl.com/hardeninglinux) > > > >-- Regards, Douglas Garstang http://www.linkedin.com/in/garstang Email: doug.garstang@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
2009/10/25 Douglas Garstang <doug.garstang@gmail.com>:> > Yes, but HOW do I order it? What is the best way to do it? I assumed > that modules were implemented in the order they are included, which > turned out to be wrong. Someone suggested that the node hierarchy > determined the order, and that didn''t work for me. I tried putting a > global Paclage{} statement in my base node that required my yum repos, > and that partly did it, but still installed yum-priorities way later > on. I tried putting a requires => Class[''yum-priorities''] in my base > class and puppet complained about module looping! >I haven''t been following the other thread but what is wrong with: * Yum class/module (which doesn''t need to install Yum since it''s in base or whatever its called) * Yum modules loads required repos (again you only need EPEL or any other non-standard repos since CentOS is already in the pre-installed repositories), installs any other packages, tasks etc. Then add a require to your site.pp or to a base node or whatever: Package { require => Class["yum"] } That will include everything in the yum class prior to executing any package resources. This doesn''t work for you? Regards James Turnbull -- Author of: * Pro Linux System Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
James, No, that didn''t work for me. When I put the default Package{} in the base node that required the class yum, puppet complained about cyclic object dependancies. Also, I do need to replace all the repo''s since we are pointing everything to our own repos and not using the public ones. The kickstart process (with help from cobbler) puts a default repo in /etc/yum.repos.d, which is just enough to get puppet and any dependancies installed. When puppet comes up, it removes this default repo and puts it''s own in /etc/yum.repos.d. There''s actually other modules that MUST be installed first, after yum. If ldap is only partialled installed, everything goes to hell in a handbasket. Even a groupadd excited by yum will just hang, so ldap needs to go in right after yum, and before anything else. Doug On Sat, Oct 24, 2009 at 5:35 PM, James Turnbull <james@lovedthanlost.net> wrote:> > 2009/10/25 Douglas Garstang <doug.garstang@gmail.com>: >> >> Yes, but HOW do I order it? What is the best way to do it? I assumed >> that modules were implemented in the order they are included, which >> turned out to be wrong. Someone suggested that the node hierarchy >> determined the order, and that didn''t work for me. I tried putting a >> global Paclage{} statement in my base node that required my yum repos, >> and that partly did it, but still installed yum-priorities way later >> on. I tried putting a requires => Class[''yum-priorities''] in my base >> class and puppet complained about module looping! >> > > I haven''t been following the other thread but what is wrong with: > > * Yum class/module (which doesn''t need to install Yum since it''s in > base or whatever its called) > * Yum modules loads required repos (again you only need EPEL or any > other non-standard repos since CentOS is already in the pre-installed > repositories), installs any other packages, tasks etc. > > Then add a require to your site.pp or to a base node or whatever: > > Package { require => Class["yum"] } > > That will include everything in the yum class prior to executing any > package resources. This doesn''t work for you? > > Regards > > James Turnbull > > -- > Author of: > * Pro Linux System Administration (http://tinyurl.com/linuxadmin) > * Pulling Strings with Puppet (http://tinyurl.com/pupbook) > * Pro Nagios 2.0 (http://tinyurl.com/pronagios) > * Hardening Linux (http://tinyurl.com/hardeninglinux) > > > >-- Regards, Douglas Garstang http://www.linkedin.com/in/garstang Email: doug.garstang@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Hi> No, that didn''t work for me. When I put the default Package{} in the > base node that required the class yum, puppet complained about cyclic > object dependancies.yeah, because you''re requiring yum for yum. As somebody suggested you should set the require to undef so to get rid off your default dependecy.> There''s actually other modules that MUST be installed first, after > yum. If ldap is only partialled installed, everything goes to hell in > a handbasket. Even a groupadd excited by yum will just hang, so ldap > needs to go in right after yum, and before anything else.then you need to model that. With another default relationship for user and group. Remember how you would have done that without puppet: you would have told your sysadmin team members, that the very first thing is that they have is to install yum and then ldap and so on. And now an additional feature pops up that you get with this behavior: If one of the installations/configurations (yum/ldap) fails ALL the upcoming things should fail as well and not be executed. With puppet you can now describe everything formally, with the old behavior you would have told your team members that they shouldn''t execute anything if they haven''t setup yum and ldap, but as you might know sometimes people don''t really listen to others and then they complain why the install script xy isn''t working. With an exact definition of order and dependencies you''ll never come up to this issue and it''s clear and readable for everybody what depends on what. You can even express this then in any kind of documentation automatically. No hidden sidemarks anymore which everybody ignores but is important. The most important thing for newcomers is that they get away from the idea that they execute a bunch of scripts (as they have done before). With puppet we are talking about managing resources, which you have to look at from a different point of view. cheers pete --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---