No, I was wrong . .  that doesn't work with augtool.  It seems to, but
won't save . . .

On Thu, Apr 16, 2015 at 12:00 PM, Guy Matz <[email protected]> wrote:

> This works with augtool but not in puppet:
>
>   augeas { 'disable all other repos in CentOS Base':
>     context => '/files/etc/yum.repos.d/CentOS-Base.repo',
>     changes => [
>       'setm /files/etc/yum.repos.d/CentOS-Base.repo/* enabled 0'
>     ]
>   }
>
> Any thoughts would be appreciated!
>
> On Thu, Apr 16, 2015 at 9:21 AM, Guy Matz <[email protected]> wrote:
>
>> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CABnTgtXMQyOwaF5d40FmVUU3AQJaVP6OgX44z4PjYYCd94fquQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to