Hi all, I''m trying to write a module to manage yum repositories but before I re-invent the wheel I was wondering if anyone out there had existing code I could adapt! I''ve looked on Puppet Forge but the only two package management modules out there appear to be for APT/Deb repos. Can anyone help? Kind regards, Matt -- 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 Jun 2, 2010, at 7:11 AM, Matt Wallace wrote:> Hi all, > > I''m trying to write a module to manage yum repositories but before I > re-invent the wheel I was wondering if anyone out there had existing > code I could adapt!I think there was a resource type built into puppet called yumrepos on the types page. I don''t know if it was just removed from the documentation during the port, or actually removed from puppet though. -- 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 Jun 2, 2010, at 10:42 AM, Patrick wrote:> > On Jun 2, 2010, at 7:11 AM, Matt Wallace wrote: > >> Hi all, >> >> I''m trying to write a module to manage yum repositories but before I >> re-invent the wheel I was wondering if anyone out there had existing >> code I could adapt! > > I think there was a resource type built into puppet called yumrepos on the types page. I don''t know if it was just removed from the documentation during the port, or actually removed from puppet though.I found it at http://docs.puppetlabs.com/references/stable/type.html#yumrepo . For some reason I just didn''t see it before. -- 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.
Matthew Macdonald-Wallace
2010-Jun-02 20:08 UTC
Re: [Puppet Users] Managing RPM Repositories
On Wed, 2010-06-02 at 10:45 -0700, Patrick wrote:> > On Jun 2, 2010, at 10:42 AM, Patrick wrote: > > > > > On Jun 2, 2010, at 7:11 AM, Matt Wallace wrote: > > > > > Hi all, > > > > > > I''m trying to write a module to manage yum repositories but before > > > I > > > re-invent the wheel I was wondering if anyone out there had > > > existing > > > code I could adapt! > > > > I think there was a resource type built into puppet called yumrepos > > on the types page. I don''t know if it was just removed from the > > documentation during the port, or actually removed from puppet > > though. > > I found it > at http://docs.puppetlabs.com/references/stable/type.html#yumrepo . > For some reason I just didn''t see it before.Awesome, thanks for that! I''ve got it working on a stand-alone manifest with puppet, however the following manifest doesn''t appear to work when placed into a puppet manifest on the server: =========================================== yumrepo{ atrpms-stable: name => "atrpms", baseurl => "http://dl.atrpms.net/el\$releasever-\ $basearch/atrpms/stable", descr => "atrpms for exim etc", enabled => "1", includepkgs => "exim-* dovecot* libspf2*", gpgkey => "http://atrpms.net/RPM-GPG-KEY.atrpms", gpgcheck => "1" } ========================================= I''m trying to setup a scenario similar to the following: site-module | |---repository modules | | | |---atrpms | |---email-server | |---package{exim:ensure=>installed} The version of exim I want to install is in atrpms, however I want to be able to use this repo for other things (I''m also using Dovecot from this repo in another module) without getting a conflict because the repo has already been defined elsewhere! Thanks in advance, Matt -- 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 Jun 2, 2010, at 1:08 PM, Matthew Macdonald-Wallace wrote:> On Wed, 2010-06-02 at 10:45 -0700, Patrick wrote: >> >> On Jun 2, 2010, at 10:42 AM, Patrick wrote: >> >>> >>> On Jun 2, 2010, at 7:11 AM, Matt Wallace wrote: >>> >>>> Hi all, >>>> >>>> I''m trying to write a module to manage yum repositories but before >>>> I >>>> re-invent the wheel I was wondering if anyone out there had >>>> existing >>>> code I could adapt! >>> >>> I think there was a resource type built into puppet called yumrepos >>> on the types page. I don''t know if it was just removed from the >>> documentation during the port, or actually removed from puppet >>> though. >> >> I found it >> at http://docs.puppetlabs.com/references/stable/type.html#yumrepo . >> For some reason I just didn''t see it before. > > Awesome, thanks for that! > > I''ve got it working on a stand-alone manifest with puppet, however the > following manifest doesn''t appear to work when placed into a puppet > manifest on the server: > > ===========================================> > yumrepo{ atrpms-stable: > name => "atrpms", > baseurl => "http://dl.atrpms.net/el\$releasever-\ > $basearch/atrpms/stable", > descr => "atrpms for exim etc", > enabled => "1", > includepkgs => "exim-* dovecot* libspf2*", > gpgkey => "http://atrpms.net/RPM-GPG-KEY.atrpms", > gpgcheck => "1" > } > > =========================================> > I''m trying to setup a scenario similar to the following: > > site-module > | > |---repository modules > | | > | |---atrpms > | > |---email-server > | > |---package{exim:ensure=>installed} > > The version of exim I want to install is in atrpms, however I want to be > able to use this repo for other things (I''m also using Dovecot from this > repo in another module) without getting a conflict because the repo has > already been defined elsewhere!Sorry, but you might have lost me. Are you saying that you''re having problems because when you define the repository in two places it throws an error? -- 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 Wed, 2010-06-02 at 15:16 -0700, Patrick wrote:> Sorry, but you might have lost me. Are you saying that you''re having problems because when you define the repository in two places it throws an error? >Not quite! :) I want to define all my repos in one module and then include the repos based upon the node class. For example: ================================ class webserver { yumrepo{["atrpms-stable","atrpms-testing","epel","centos-base"]} # install webserver stuff ... #finish } class mailserver { yumrepo{[''"centos-base","epel","elff"]} # do mailserver install ... # finish mailserver install } ================================ and then in my repos module: ================================ yumrepo{ atrpms-stable: name => "atrpms", baseurl => "http://dl.atrpms.net/el\$releasever-\ $basearch/atrpms/stable", descr => "atrpms for exim etc", enabled => "1", includepkgs => "exim-* dovecot* libspf2* libsrs*", gpgkey => "http://atrpms.net/RPM-GPG-KEY.atrpms", gpgcheck => "1" } yumrepo{ atrpms-testing: name => "atrpms-testing", baseurl => "http://dl.atrpms.net/el\$releasever-\ $basearch/atrpms/testing", descr => "atrpms for exim etc", enabled => "1", includepkgs => "exim-* dovecot* libspf* libsrs*", gpgkey => "http://atrpms.net/RPM-GPG-KEY.atrpms", gpgcheck => "1" } ================================== So I only get the minimal repos needed for each node class. At the moment I can include all the repos or none of the repos and I''d like to bemore subtle about it without having to redefine each repo for each class it is used in. If there''s a more appropriate/better way of achieving this, please let me know! Kind regards, Matt -- 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.
Matt Wallace <lists@truthisfreedom.org.uk> writes:> On Wed, 2010-06-02 at 15:16 -0700, Patrick wrote: > >> Sorry, but you might have lost me. Are you saying that you''re having >> problems because when you define the repository in two places it throws an >> error? > > Not quite! :) > > I want to define all my repos in one module and then include the repos > based upon the node class. > > For example: > > ================================> > class webserver { > yumrepo{["atrpms-stable","atrpms-testing","epel","centos-base"]}include repo::atrpms-stable include repo::epel [...] [...]> and then in my repos module: > ================================>class repo::atrpms-stable {> yumrepo{ atrpms-stable:} [...]> So I only get the minimal repos needed for each node class....but from experience I wouldn''t recommend doing this. You are almost certainly going to be better off having the same set of repositories on every server, and using some other mechanism to control which packages or updates are applied to your systems. Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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, 2010-06-03 at 18:22 +1000, Daniel Pittman wrote:> ...but from experience I wouldn''t recommend doing this. You are almost > certainly going to be better off having the same set of repositories on every > server, and using some other mechanism to control which packages or updates > are applied to your systems.Ok, that makes sense. I''ve updated my manifests to reflect the above, however now when I run Yum manually on the servers I get the following output: Repository ''epel'' is missing name in configuration, using id It doesn''t make a difference to the install, I''m just wondering if I''m missing a flag from the following: yumrepo{epel: name => "Epel", baseurl=> "http://updates.the.namesco.net/centos\$releasever-\ $basearch/RPMS.epel/", gpgcheck=> "1", gpgkey=> "http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL", enabled=> "1", includepkgs=> "puppet* ruby* facter augeas-libs ruby-augeas ruby-shadow munin-common munin-node munin-server pyparsing libvirt* libyaml* PyYAML* cobbler* Django* python-netaddr", } Thanks in advance, Matt -- 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.
Matt Wallace wrote:> I''ve updated my manifests to reflect the above, however now when I run > Yum manually on the servers I get the following output: > > Repository ''epel'' is missing name in configuration, using id > > > It doesn''t make a difference to the install, I''m just wondering if I''m > missing a flag from the following: > > yumrepo{epel: > name => "Epel", > baseurl=> "http://updates.the.namesco.net/centos\$releasever-\ > $basearch/RPMS.epel/", > gpgcheck=> "1", > gpgkey=> "http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL", > enabled=> "1", > includepkgs=> "puppet* ruby* facter augeas-libs ruby-augeas ruby-shadow > munin-common munin-node munin-server pyparsing libvirt* libyaml* PyYAML* > cobbler* Django* python-netaddr", > }You should set the descr parameter. From the yumrepo docs: descr A human readable description of the repository. This corresponds to the name parameter in yum.conf(5). Set this to ‘absent’ to remove it from the file completely Valid values are absent. Values can match /.*/. So rather than name => "Epel", use descr => "Epel" and should be be good. (Though a pedant would tell you to spell it as EPEL. ;) -- Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fleas can be taught nearly anything that a Congressman can. -- Mark Twain