Ask Your Question

Add extra value to a parameter in file

asked 2016-04-04 11:06:13 -0600

stanislas93 gravatar image


With this configuration , I can add the parameter "exclude" in the yum.conf file if it does not exist with the value " kernel" .

augeas { yumexcludekernel: context => '/files/etc/yum.conf/main', changes => "set exclude 'kernel'" }

But, if there is already this parameter with a different value, it is overwritten...

My question is: how to add another value with a space between values ​​without overwrite the existing one ?

Is this possible with augeas ?


edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-04-05 03:10:52 -0600

I don't know whether this is possible with augeas. But you can also use inisubsetting (from inifile module).

edit flag offensive delete link more

answered 2016-04-05 10:12:35 -0600

stanislas93 gravatar image

Thanks a lot, this conf is good :

ini_subsetting {'kernel_exclude':
  path                  => '/etc/yum.conf',
  section               => 'main',
  setting               => 'exclude',
  subsetting            => 'kernel*',
  subsetting_separator  => ' ',
  ensure                => present,
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-04-04 11:06:13 -0600

Seen: 137 times

Last updated: Apr 05 '16