User Tools

Site Tools


augeas

Augeas / augtool

Uncomment a Line

augtool --backup <<END
rename /files/etc/ssh/sshd_config/#comment[. =~ regexp('PermitRootLogin.*')] PermitRootLogin
set /files/etc/ssh/sshd_config/PermitRootLogin without-password
save
END

Load a File with A Specific Lens

:~# augtool --backup
augtool> set /augeas/load/Shellvars/incl[last()+1] "/etc/exim4/update-exim4.conf.conf"
augtool> load
augtool> set /files/etc/exim4/update-exim4.conf.conf/dc_smarthost 'mail.domain.com'
augtool> save
augtool> quit

Puppet

augeas { "exim4-config":
  lens    => 'Shellvars.lns',
  incl    => '/etc/exim4/update-exim4.conf.conf',
  context => '/files/etc/exim4/update-exim4.conf.conf',
  changes => [
    "set dc_smarthost 'mail.domain.com'"
  ],
}
augeas.txt · Last modified: 2020/02/13 22:55 (external edit)

free spam filter