I''m running puppet 0.24.6 on CentOS 5.2 from a puppetmaster on a virtual server to a variety of client servers both virtual and metal running either CentOS 5.2 or Fedora Core 10. I want to extend this to servers running RHEL 5 (and 6) in the near future. My problem is I have puppet set up with all repositories (mirrored locally using cobbler) included in one file in /etc/yum.repos.d/kewrepos.repo on the puppermaster. This file contains both Centos and Fedora repos and when I run a yum update I just -- disablerepo=whichever I don''t want, which can be done as a cron job. The difficulty is sometimes puppet runs yum automatically, which loops on a CentOS webserver trying to reinstall httpd, getting confused by the presence of Fedora repositories. My question is how can I set up puppet so that I can tell, once and for all, The Fedora boxes to look at the Fedora repos and the CentOS boxes to CentOS repos only? I want to be able to configure unlimited repos in the future for workstations (Fedora) and servers (CentOS or RHEL). Thanks in advance Tim Kendall I just added Kew Gardens where I work to your Wiki list of users --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''m running puppet 0.24.6 on CentOS 5.2 from a puppetmaster on a virtual server to a variety of client servers both virtual and metal running either CentOS 5.2 or Fedora Core 10. I want to extend this to servers running RHEL 5 (and 6) in the near future. My problem is I have puppet set up with all repositories (mirrored locally using cobbler) included in one file in /etc/yum.repos.d/kewrepos.repo on the puppermaster. This file contains both Centos and Fedora repos and when I run a yum update I just -- disablerepo=whichever I don''t want, which can be done as a cron job. The difficulty is sometimes puppet runs yum automatically, which loops on a CentOS webserver trying to reinstall httpd, getting confused by the presence of Fedora repositories. My question is how can I set up puppet so that I can tell, once and for all, The Fedora boxes to look at the Fedora repos and the CentOS boxes to CentOS repos only? I want to be able to configure unlimited repos in the future for workstations (Fedora) and servers (CentOS or RHEL). Thanks in advance Tim Kendall I just added Kew Gardens where I work to your Wiki list of users --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I administer both RHEL4 and 5 with puppet, and all the software is on a local yum mirror. I use the yumrepo type in my base class, which all others depend on, and use some facts from facter to generate a uniq repo path based on both the version and architecture. I use something like this; baseurl => "http://<something>/$operatingsystem/ $operatingsystemrelease/$architecture/". For a RHEL4 running on i386, this becomes "http://<something>/redhat/4/ i386/" I would suggest running facter and creating a path that matches your mindset for you repository, but for me this has worked very well so far. In the same class that enables this, you should also remember to disable your kewrepos.repo, or the result of a update could be rather "interesting". :-) I hope this helps! BR. Rune Stensø On 29 Apr, 17:14, "T.Kend...@kew.org" <trkend...@googlemail.com> wrote:> I''m running puppet 0.24.6 on CentOS 5.2 from a puppetmaster on a > virtual server to a variety > of client servers both virtual and metal running either CentOS 5.2 or > Fedora Core 10. I want to > extend this to servers running RHEL 5 (and 6) in the near future. > > My problem is I have puppet set up with all repositories (mirrored > locally using cobbler) > included in one file in /etc/yum.repos.d/kewrepos.repo on the > puppermaster. This file contains > both Centos and Fedora repos and when I run a yum update I just -- > disablerepo=whichever I don''t want, > which can be done as a cron job. > > The difficulty is sometimes puppet runs yum automatically, which loops > on a CentOS webserver > trying to reinstall httpd, getting confused by the presence of Fedora > repositories. > > My question is how can I set up puppet so that I can tell, once and > for all, The Fedora boxes to > look at the Fedora repos and the CentOS boxes to CentOS repos only? I > want to be able to > configure unlimited repos in the future for workstations (Fedora) and > servers (CentOS or RHEL). > > Thanks in advance > > Tim Kendall > > I just added Kew Gardens where I work to your Wiki list of users--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
The first thing I would do; split the repositories up. In your case I would have only the CentOS specific repositories available under "/etc/ yum.repos.d/" for CentOS. servers. There are several ways to achieve this. - During the Kickstart process add a repository specifically for CentOS or Fedora in the "%post" section. - Create separate base classes, one for Fedora and one for CentOS. In each base class use the "yumrepo" type to define the different YUM repositories. On Apr 29, 11:14 am, "T.Kend...@kew.org" <trkend...@googlemail.com> wrote:> I''m running puppet 0.24.6 on CentOS 5.2 from a puppetmaster on a > virtual server to a variety > of client servers both virtual and metal running either CentOS 5.2 or > Fedora Core 10. I want to > extend this to servers running RHEL 5 (and 6) in the near future. > > My problem is I have puppet set up with all repositories (mirrored > locally using cobbler) > included in one file in /etc/yum.repos.d/kewrepos.repo on the > puppermaster. This file contains > both Centos and Fedora repos and when I run a yum update I just -- > disablerepo=whichever I don''t want, > which can be done as a cron job. > > The difficulty is sometimes puppet runs yum automatically, which loops > on a CentOS webserver > trying to reinstall httpd, getting confused by the presence of Fedora > repositories. > > My question is how can I set up puppet so that I can tell, once and > for all, The Fedora boxes to > look at the Fedora repos and the CentOS boxes to CentOS repos only? I > want to be able to > configure unlimited repos in the future for workstations (Fedora) and > servers (CentOS or RHEL). > > Thanks in advance > > Tim Kendall > > I just added Kew Gardens where I work to your Wiki list of users--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I prefer copying the repos over using a template. This way all my CentOS boxes have the same repos. If I were to add any Fedora boxes to the mix I''d add the repos to the Fedora {} block. case $operatingsystem { CentOS : { file { "epel" : path => "/etc/yum.repos.d/epel.repo", owner => root, group => root, mode => 644, content => template("yum-module/epel.repo.erb"), ensure => file } } Fedora : { # Fedora repos here } } Here is the template that goes in the /etc/puppet/modules/yum-module/template/ directory == SNIP = [epel] name=Extra Packages for Enterprise Linux <%= lsbmajdistrelease %> - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/<%= lsbmajdistrelease %>/$basearch mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-<%= lsbmajdistrelease %>&arch=$basearch failovermethod=priority enabled=<%= enableme %> gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL == SNIP = -Brandon T.Kendall@kew.org wrote:> I''m running puppet 0.24.6 on CentOS 5.2 from a puppetmaster on a > virtual server to a variety > of client servers both virtual and metal running either CentOS 5.2 or > Fedora Core 10. I want to > extend this to servers running RHEL 5 (and 6) in the near future. > > My problem is I have puppet set up with all repositories (mirrored > locally using cobbler) > included in one file in /etc/yum.repos.d/kewrepos.repo on the > puppermaster. This file contains > both Centos and Fedora repos and when I run a yum update I just -- > disablerepo=whichever I don''t want, > which can be done as a cron job. > > The difficulty is sometimes puppet runs yum automatically, which loops > on a CentOS webserver > trying to reinstall httpd, getting confused by the presence of Fedora > repositories. > > My question is how can I set up puppet so that I can tell, once and > for all, The Fedora boxes to > look at the Fedora repos and the CentOS boxes to CentOS repos only? I > want to be able to > configure unlimited repos in the future for workstations (Fedora) and > servers (CentOS or RHEL). > > Thanks in advance > > Tim Kendall > > I just added Kew Gardens where I work to your Wiki list of users > > >--~--~---------~--~----~------------~-------~--~----~ 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 Brandon, thanks for this. I''m new to puppet and I have also inherited a setup from a consultant who was at Kew before me. I don''t have a yum module, but I have a yum.pp in /etc/puppet/ manifests/classes which tells the puppetmaster to distribute a yum.conf and a repos.repo (a list of all local Fedora and CentOS repos) to the puppet clients. My site.pp contains "include yum". I don''t have anything anywhere called *.repo.erb. If I made yum just one of many modules (put it in with ssh, amanda, mysql and all the others) I would just add a line to /etc/puppet/manifests/modules.pp and add something like your second snip into /etc/puppet/modules/yum/template/ to point to the local mirrors. But where should I put this first bit of syntax beginning case $operatingsystem and what should I call it? My current repos.repo refers to $basearch and $releasever which are obviously variables set from facter facts (like in your second snip) but I can''t see where those are set at the moment. Could I just change the current yum.pp to include the case$operating system? Help most welcome! Tim On Apr 30, 10:19 pm, Brandon Evans <bev...@adicio.com> wrote:> I prefer copying the repos over using a template. This way all my > CentOS boxes have the same repos. If I were to add any Fedora boxes to > the mix I''d add the repos to the Fedora {} block. > > case $operatingsystem { > CentOS : { > > file { "epel" : > path => "/etc/yum.repos.d/epel.repo", > owner => root, > group => root, > mode => 644, > content => template("yum-module/epel.repo.erb"), > ensure => file > } > } > Fedora : { > # Fedora repos here > } > > } > > Here is the template that goes in the > /etc/puppet/modules/yum-module/template/ directory > > == SNIP => > [epel] > name=Extra Packages for Enterprise Linux <%= lsbmajdistrelease %> - > $basearch > #baseurl=http://download.fedoraproject.org/pub/epel/<%> lsbmajdistrelease %>/$basearch > mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-<%> lsbmajdistrelease %>&arch=$basearch > failovermethod=priority > enabled=<%= enableme %> > gpgcheck=1 > gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL > > == SNIP => > -Brandon > > T.Kend...@kew.org wrote: > > I''m running puppet 0.24.6 on CentOS 5.2 from a puppetmaster on a > > virtual server to a variety > > of client servers both virtual and metal running either CentOS 5.2 or > > Fedora Core 10. I want to > > extend this to servers running RHEL 5 (and 6) in the near future. > > > My problem is I have puppet set up with all repositories (mirrored > > locally using cobbler) > > included in one file in /etc/yum.repos.d/kewrepos.repo on the > > puppermaster. This file contains > > both Centos and Fedora repos and when I run a yum update I just -- > > disablerepo=whichever I don''t want, > > which can be done as a cron job. > > > The difficulty is sometimes puppet runs yum automatically, which loops > > on a CentOS webserver > > trying to reinstall httpd, getting confused by the presence of Fedora > > repositories. > > > My question is how can I set up puppet so that I can tell, once and > > for all, The Fedora boxes to > > look at the Fedora repos and the CentOS boxes to CentOS repos only? I > > want to be able to > > configure unlimited repos in the future for workstations (Fedora) and > > servers (CentOS or RHEL). > > > Thanks in advance > > > Tim Kendall > > > I just added Kew Gardens where I work to your Wiki list of users--~--~---------~--~----~------------~-------~--~----~ 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 Brandon, thanks for this. I''m new to puppet and I have also inherited a setup from a consultant who was at Kew before me. I don''t have a yum module, but I have a yum.pp in /etc/puppet/ manifests/classes which tells the puppetmaster to distribute a yum.conf and a repos.repo (a list of all local Fedora and CentOS repos) to the puppet clients. My site.pp contains "include yum". I don''t have anything anywhere called *.repo.erb. If I made yum just one of many modules (put it in with ssh, amanda, mysql and all the others) I would just add a line to /etc/puppet/manifests/modules.pp and add something like your second snip into /etc/puppet/modules/yum/template/ to point to the local mirrors. But where should I put this first bit of syntax beginning case $operatingsystem and what should I call it? My current repos.repo refers to $basearch and $releasever which are obviously variables set from facter facts (like in your second snip) but I can''t see where those are set at the moment. Could I just change the current yum.pp to include the case$operating system? Help most welcome! Tim On Apr 30, 10:19 pm, Brandon Evans <bev...@adicio.com> wrote:> I prefer copying the repos over using a template. This way all my > CentOS boxes have the same repos. If I were to add any Fedora boxes to > the mix I''d add the repos to the Fedora {} block. > > case $operatingsystem { > CentOS : { > > file { "epel" : > path => "/etc/yum.repos.d/epel.repo", > owner => root, > group => root, > mode => 644, > content => template("yum-module/epel.repo.erb"), > ensure => file > } > } > Fedora : { > # Fedora repos here > } > > } > > Here is the template that goes in the > /etc/puppet/modules/yum-module/template/ directory > > == SNIP => > [epel] > name=Extra Packages for Enterprise Linux <%= lsbmajdistrelease %> - > $basearch > #baseurl=http://download.fedoraproject.org/pub/epel/<%> lsbmajdistrelease %>/$basearch > mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-<%> lsbmajdistrelease %>&arch=$basearch > failovermethod=priority > enabled=<%= enableme %> > gpgcheck=1 > gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL > > == SNIP => > -Brandon > > T.Kend...@kew.org wrote: > > I''m running puppet 0.24.6 on CentOS 5.2 from a puppetmaster on a > > virtual server to a variety > > of client servers both virtual and metal running either CentOS 5.2 or > > Fedora Core 10. I want to > > extend this to servers running RHEL 5 (and 6) in the near future. > > > My problem is I have puppet set up with all repositories (mirrored > > locally using cobbler) > > included in one file in /etc/yum.repos.d/kewrepos.repo on the > > puppermaster. This file contains > > both Centos and Fedora repos and when I run a yum update I just -- > > disablerepo=whichever I don''t want, > > which can be done as a cron job. > > > The difficulty is sometimes puppet runs yum automatically, which loops > > on a CentOS webserver > > trying to reinstall httpd, getting confused by the presence of Fedora > > repositories. > > > My question is how can I set up puppet so that I can tell, once and > > for all, The Fedora boxes to > > look at the Fedora repos and the CentOS boxes to CentOS repos only? I > > want to be able to > > configure unlimited repos in the future for workstations (Fedora) and > > servers (CentOS or RHEL). > > > Thanks in advance > > > Tim Kendall > > > I just added Kew Gardens where I work to your Wiki list of users--~--~---------~--~----~------------~-------~--~----~ 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 Tim,> I don''t have a yum module, but I have a yum.pp in /etc/puppet/ > manifests/classes which tells the puppetmaster to distribute a > yum.conf and a repos.repo (a list of all local Fedora and CentOS > repos) to the puppet clients.Managing yum is a good place to start with puppet. It''s somewhat harmless to the system if you mess up & it can be as complex or as simple as you want it to be. My yum.pp has 5 ways to get the repos out. Only 2 are used while the other methods are left behind for my own reference. My site.pp contains "include yum". I> don''t > have anything anywhere called *.repo.erb. If I made yum just one of > many modules (put it in with ssh, amanda, mysql and all the others) > I would just add a line to /etc/puppet/manifests/modules.pp and add > something like your second snip into /etc/puppet/modules/yum/template/ > to point to the local mirrors.Yup. The .erb files are template files. Puppet will read in the specified template and replace any <%= VARIABLE %> it finds. This worked great with the epel.repo because very little changes between CentOS 4 & 5 in the actual epel.repo file. All I really needed to change was The number 4 & 5 which Puppet figures out via Facter using the $lsbmajdistrelease variable.> > But where should I put this first bit of syntax beginning case > $operatingsystem and what should I call it? My current repos.repo > refers to $basearch and $releasever which are obviously variables set > from facter facts (like in your second snip) but I can''t see where > those are set at the moment.Well, kinda. $basearch and $releasever are variables that ( I think ) yum uses. They have nothing to do with puppet. *This only applies to templates*. Within your Puppet manifests $variable *are* puppet variables. The only variable I use for puppet templating is <%= lsbmajdistrelease %> Templates are good if there are only minor changes that need to be made in each file. For more on templating check out http://reductivelabs.com/trac/puppet/wiki/PuppetTemplating Could I just change the current yum.pp to> include the case$operating system?Yes. The yum.pp is where you would put that case statement. If you want to simplify things and not use templates, another way to do it ( which I also use ) would be like this. case $operatingsystem { CentOS : { file { "/etc/yum.repos.d/CentOS-Base.repo" : ensure => file, mode => 644, owner => root, group => root, source => "puppet:///yum-module/noarch/etc/yum.repos.d/CentOS-Base.repo-$lsbdistid.$lsbmajdistrelease", } Fedora : { file { "/etc/yum.repos.d/Fedora-Base.repo" : ensure => file, mode => 644, owner => root, group => root, source => "puppet:///yum-module/noarch/etc/yum.repos.d/Fedora-Base.repo-$lsbdistid.$lsbmajdistrelease", } } } In this situation the case{} block would live in your yum.pp and the repo files would live in: /etc/puppet/modules/yum-module/files/noarch/etc/yum.repos.d/CentOS-Base.repo-CentOS.5 /etc/puppet/modules/yum-module/files/noarch/etc/yum.repos.d/CentOS-Base.repo-CentOS.4 /etc/puppet/modules/yum-module/files/noarch/etc/yum.repos.d/CentOS-Base.repo-Fedora.9 ... ... I don''t have any fedora boxes to test so I''m not 100% sure facter returns "Fedora" as the $lsbdistid variable. Run facter on one of your Fedora boxes to find out. Hopefully this helps you out. Left me know if you have any more questions or hop into #puppet in freenode. There is usually someone there who will answer any questions you have. -Brandon Evans> Help most welcome! Tim > > On Apr 30, 10:19 pm, Brandon Evans <bev...@adicio.com> wrote: >> I prefer copying the repos over using a template. This way all my >> CentOS boxes have the same repos. If I were to add any Fedora boxes to >> the mix I''d add the repos to the Fedora {} block. >> >> case $operatingsystem { >> CentOS : { >> >> file { "epel" : >> path => "/etc/yum.repos.d/epel.repo", >> owner => root, >> group => root, >> mode => 644, >> content => template("yum-module/epel.repo.erb"), >> ensure => file >> } >> } >> Fedora : { >> # Fedora repos here >> } >> >> } >> >> Here is the template that goes in the >> /etc/puppet/modules/yum-module/template/ directory >> >> == SNIP =>> >> [epel] >> name=Extra Packages for Enterprise Linux <%= lsbmajdistrelease %> - >> $basearch >> #baseurl=http://download.fedoraproject.org/pub/epel/<%>> lsbmajdistrelease %>/$basearch >> mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-<%>> lsbmajdistrelease %>&arch=$basearch >> failovermethod=priority >> enabled=<%= enableme %> >> gpgcheck=1 >> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL >> >> == SNIP =>> >> -Brandon >> >> T.Kend...@kew.org wrote: >>> I''m running puppet 0.24.6 on CentOS 5.2 from a puppetmaster on a >>> virtual server to a variety >>> of client servers both virtual and metal running either CentOS 5.2 or >>> Fedora Core 10. I want to >>> extend this to servers running RHEL 5 (and 6) in the near future. >>> My problem is I have puppet set up with all repositories (mirrored >>> locally using cobbler) >>> included in one file in /etc/yum.repos.d/kewrepos.repo on the >>> puppermaster. This file contains >>> both Centos and Fedora repos and when I run a yum update I just -- >>> disablerepo=whichever I don''t want, >>> which can be done as a cron job. >>> The difficulty is sometimes puppet runs yum automatically, which loops >>> on a CentOS webserver >>> trying to reinstall httpd, getting confused by the presence of Fedora >>> repositories. >>> My question is how can I set up puppet so that I can tell, once and >>> for all, The Fedora boxes to >>> look at the Fedora repos and the CentOS boxes to CentOS repos only? I >>> want to be able to >>> configure unlimited repos in the future for workstations (Fedora) and >>> servers (CentOS or RHEL). >>> Thanks in advance >>> Tim Kendall >>> I just added Kew Gardens where I work to your Wiki list of users > >--~--~---------~--~----~------------~-------~--~----~ 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 Thu, 2009-04-30 at 14:19 -0700, Brandon Evans wrote:> I prefer copying the repos over using a template. This way all my > CentOS boxes have the same repos. If I were to add any Fedora boxes to > the mix I''d add the repos to the Fedora {} block.Instead of using a template, you can also use the yumrepo type. David --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---