[augeas-devel] Match question!

James Patterson jamespatterson at operamail.com
Fri Sep 14 06:49:22 UTC 2012


Two questions about Match, both using sshd_config as an example.

Calling augeas from Puppet, I can do this:

context => '/files/etc/ssh/sshd_config',
changes => [
 'ins PermitTunnel before Match[1]',
 'set PermitTunnel yes',
],
onlyif => 'get PermitTunnel != yes',

My problem is that I normally don't have a Match block (and would like
to avoid creating a dummy one).

1. How can I insert the parameter before the Match block if the Match
block exists, otherwise just insert the parameter?

2. How does it work with this line? (the line already exists in the
config)

Set Subsystem sftp /usr/libexec/openssh/sftp-server

context => '/files/etc/ssh/sshd_config',
changes => [
 'ins Subsystem before Match[1]',
 'set Subsystem/sftp "internal-sftp"',
],
onlyif => 'get Subsystem/sftp != "internal-sftp"',

(do I really need the onlyif part?)

Thanks.
-- 
  James Patterson
  jamespatterson at operamail.com

-- 
http://www.fastmail.fm - Send your email first class




More information about the augeas-devel mailing list