• contact
  • about
Home

yum repo and package dependencies with puppet

rene — Mon, 06/28/2010 - 19:11

Over the last couple of months I've been using puppet to help scale out sysadmin tasks. As puppet manifests are based on a declarative programming language I've discovered you can not rely on flow control such as 'drop in a RPM GPG key, then configure repo foo. Once both of those tasks are done install package bar from repo foo' unless you add some smarts.

This is how I install a package on a RHEL5/CentOS/Fedora type system which depends on a yum repo first which in turn depends on a GPG key.

Within the puppet manifest first define a file resource for the GPG key that RPM needs to install packages from the EPEL repository

file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL":
    owner => root,
    group => root,
    mode => 0444,
    source => "puppet:///yum/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL"
}

The yum puppet module I have has RPM-GPG-KEY-EPEL in /etc/puppet/modules/yum/files/etc/pki/rpm-gpg/ on the puppetmaster server.

Next define a yumrepo resource with the repo details. Note the 'require' attribute which references the GPG key file resource.

yumrepo { "epel":
    mirrorlist => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch',
    enabled => 1,
    gpgcheck => 1,
    gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL",
    require => File["/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL"]
}

Finally the package resource which references the yumrepo resource.

package { [
        "nginx",
        "rtpproxy"
        ]:
    ensure => latest,
    require => Yumrepo[ "epel" ],
}


photos im taking

Bus laneThat wayYellow red yellow red yellow redHer leadNight crossing in ClaytonWalk with careFire hydrant in ClaytonPear upside down cakeGlass of wine with a wine barrelPancakes in the afternoon. NOMsThe Cuckoo in OlindaEastern Beach, GeelongThe Geelong maestroHawthorn vs Geelong at the MCGSt Marys church in GeelongSeaplane at Eastern Beach in GeelongMiss Marples Sundae BestChristmas in July at Miss Marplesfound in old album store in Sassafrasoutside tea store in sassafrasEarl and green teaphoto.JPGantique store in the dandenongschicken parmigiana at rangersbruschetta at rangers in the dandenongstimeball towerDO NOT USE 50 cents!!!veggie patch week 2Port Phillip Bay from WilliamstownHMAS Castlemaine at Gem Pier, Williamstown

about me


Passionate Systems Engineer.
Want to know more?

search rene.bz

what im reading

  • Step 224: The Value of Discipline
  • Pirate Bay Founder’s Flattr Opens To The Public, Vote For Sites You Visit With Money
  • Apple Pulls Camera+ From The App Store After Its Developers Reveal A Contraband Feature
  • Google Begins Rapid Iteration Plan With Chrome 6 Beta Deployment
  • Oracle outlines Solaris 11, says little of OpenSolaris
  • 9 Helpful Tips To Deal With Negative People
  • Step 221: Entrepreneurs Equally Confident and Vulnerable
  • Step 220: Life on Our Own Terms
  • Digg To AOL Exodus Claims Biz Dev VP Bob Buch
  • Step 218: Thinking and Doing Are Two Different Things
  • Pivoting 101
  • A word of advice from my father about being frugal.
  • Fighting the summer productivity blahs
  • App Update: BlurFX
  • The elements of change
  • The Life Changing Nature of Gratitude
  • Evernote Essentials: The definitive guide to using Evernote
  • 9 Expert Tips For Better Writing
  • Coburg, Melbourne #iphoneography
  • Media Exponential
more

what im bookmarking

  • 7.2. re — Regular expression operations — Python v2.7 documentation
  • 7.2. re — Regular expression operations — Python v2.7 documentation
  • Intel® Xeon® Processor Family
  • GettingStarted - apt-cyg - Getting started with apt-cyg - Project Hosting on Google Code
  • GettingStarted - apt-cyg - Getting started with apt-cyg - Project Hosting on Google Code
  • Ten launches channel Eleven
  • Ten launches channel Eleven
  • access.redhat.com | Red Hat Knowledgebase: How do I find the FC ID (WWN) of a disk/LUN on Red Hat Enterprise Linux 5?
  • access.redhat.com | Red Hat Knowledgebase: How do I find the FC ID (WWN) of a disk/LUN on Red Hat Enterprise Linux 5?
  • Squid access.log
  • Squid access.log
  • WIPmania - WorldIP free geolocation database, service and tools - free database
  • WIPmania - WorldIP free geolocation database, service and tools - free database
  • MediaCorp wins copyright case - Managing Intellectual Property - March 2010
  • MediaCorp wins copyright case - Managing Intellectual Property - March 2010
  • Web VCR site revives Net TV debates - CNET News
  • Web VCR site revives Net TV debates - CNET News
  • RecordTV.com to sell assets - CNET News
  • RecordTV.com to sell assets - CNET News
  • Channel's Seven, Nine and Ten set to launch new channels this year
more
  • contact
  • about