Many thanks for your reply, unfortunately I'm quickly getting into a
mess:

On Wed, May 16, 2012, at 07:58 AM, jcbollinger wrote:
> 
> 
> On May 15, 9:32 am, Biltong <[email protected]> wrote:
> > I have a class that pulls in some yum repositories. One of the yum
> > repositories is disabled, but on one host I'd like to enable it.
> >
> > i.e. I'd like to do something like this:
> >
> > class { 'myyumrepos': }
> > yumrepo { 'EPEL': enabled => 1, }
> >
> > What's the best way to do this?
> >
> > I am using an ENC.
> 
> 
> Closest to what you actually wrote might be
> 
> class myyumrepos::epel_enabled inherits myyumrepos {
>   Yumrepo['EPEL'] { enabled => 1 }
> }
> 
> include 'myyumrepos::epel_enabled'

My problem ehre is that I would need an myyumrepos::epel_enabled and an
myyumrepos::epel_disabled, which seems very counter-intuitive (and with
a lot of repetition for each other repository).

What I'd like is to do define some defaults like this:
'EPEL'
  enabled 1
  gpgcheck 0
  baseurl http://internal/EPEL
'OMGREPO'
  enabled 0
  gpgcheck 1
  baseurl http://internal/OMGREPO

then to enable it, but changing those defaults:

myrepos::repo {
 'EPEL'
   enabled 0
 'OMGREPO'
   enabled 1
   gpgcheck 0
}

**note: syntax removed above**

The alternative is to put the repo name, enabled flag, baseurl, gpgcheck
flag in each node manifest, which is also not good.

> Better, however, might be for class myyumrepos to rely on an external
> data source (e.g. via hiera) to choose the correct 'enabled' value for
> each repo in the first place:
> 
> # (in class myyumrepos)
> yumrepo { 'EPEL':
>   # ...
>   enabled => hiera('EPEL_enabled')
>   # ...
> }

I can see this as being better, but it seems like a work around for not
being able to represent (or think of a way to represent) the information
above in puppet. I'd end up with a boolean for every repo, and the other
options for each repo. Is there a way to do this without hiera, like
using the imaginary syntax above?

> 
> 
> John
> 
> -- 
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
> 

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to