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
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
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!!