Hi!  I'm trying to disable yum repos using augeas and can't quite figure
out how to set enabled=0 for all repos in a yum file.  I've got this:

  augeas { 'disable all repos in CentOS Base':
    context => '/files/etc/yum.repos.d/CentOS-Base.repo',
    changes => [
      'setm */enabled . 0'
    ]
  }

Which works if a repo has an enabled line.  The problem is that it doesn't
*add* an enabled line to a repo that does not.  For example, the enabled
line here will get set to enabled=0:
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=
http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

but an enabled=0 will not get added to this:
[base]
name=CentOS-$releasever - Base
mirrorlist=
http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


Anyone know how/if I can hit these two birds with one stone?

Thanks!!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CABnTgtW5k_hBcM_8N8UaBO3kfkJcQzvf4748wgPxLLToR-vOBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to