Code Monkey home page Code Monkey logo

yumrepos's Introduction

yumrepos puppet module

About

I was sick of having modules for various repos and module dependencies for yet another EPEL module.

This has a dependency on the puppetlabs/stdlib for validation checks.

Simply throw the $repos parameter a nested hash of repos and stop writing yumrepo modules.

If the $heria_hash parameter is true values for $repos across all hierarchies are used so repos can be defined at multiple levels. This allows for a base set of repos to be defined at a low level of the hierarchy and more specific repos to be defined further up the hierarchy closer to what is likely more relevant definitions.

There is also a $defaults parameter intended to minimise boiler plate. This enables default attributes to be set once and applied for all puppet defined yumrepos. In this module this is set to ensure the repo is enabled. Handy if you have to proxy all your repos or something for example.

If the attribute is defined in both $repos and $defaults the value in $repos takes precedence.

The $purge parameter takes a boolean, if true all yumrepos and rpm-gpg keys will be purged unless they are provided by puppet. This defaults to false.

Usage

Include the class

include yumrepos

Pass the class a nested hash of repos

$repos = {
  epel => {
  descr     => 'Extra Packages for Enterprise Linux 6 - x86_64',
  baseurl   => 'http://download.fedoraproject.org/pub/epel/6/$basearch',
  gpgkey    => '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6',
  priority  => '10',
  }
  myrepo => {
  descr     => 'Local mirror of Foo',
  baseurl   => 'http://foo.server.com/6/$basearch',
  gpgkey    => '/etc/pki/rpm-gpg/RPM-GPG-KEY-foo',
  priority  => '10',
  }
}

Set all repos to check gpgkeys

$defaults = {
  ensure    => present,
  enabled   => true,
  gpgcheck  => true,
}

You can provide keys by dropping them into the files directory of this module

yumrepos's People

Contributors

george-b avatar robrankin avatar

Watchers

James Cloos avatar George Brown avatar  avatar  avatar

yumrepos's Issues

Error on applying this module

When configuring this module I run into an error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: "" is not a Hash.  It looks to be a String at /etc/puppet/modules/yumrepos/manifests/init.pp:33 on node host.example.com

I've used this module like this: (Without defining any repository yet.)

node default {
  include yumrepos
}

node 'host.example.com' inherits default {
}

My environments versions are:

# puppet --version
3.7.4
# puppet module list
/etc/puppet/modules
├── ajjahn-dns (v1.1.0)
├── gbrown-yumrepos (v0.0.3)
├── puppetlabs-apache (v1.2.0)
├── puppetlabs-apt (v1.7.0)
├── puppetlabs-concat (v1.1.2)
├── puppetlabs-firewall (v1.4.0)
├── puppetlabs-inifile (v1.2.0)
├── puppetlabs-ntp (v3.3.0)
├── puppetlabs-postgresql (v4.1.0)
├── puppetlabs-puppetdb (v4.1.0)
├── puppetlabs-stdlib (v4.5.1)
├── saz-resolv_conf (v3.0.3)
├── saz-ssh (v2.4.0)
├── saz-sudo (v3.0.9)
├── stahnma-epel (v1.0.2)
├── stephenrjohnson-puppet (v1.3.1)
├── thias-postfix (v0.3.3)
├── torrancew-account (v0.0.5)
└── custom (???)
/usr/share/puppet/modules (no modules installed)

This might be an implementation problem from my side, in that case, please update the documentation, I would love to use this module, it fits my requirements perfectly.

Need tests

Currently this module contains no tests. While most of the behavior is defined by parameters it would still be good to have basic syntax and style checks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.