Hi all,

I'm trying to insert a ClientAliveInterval setting into sshd_config with augeas. Some servers have a "Match User" line (so the new setting needs to come before the "Match User" line), and some don't. Some already have a ClientAliveInterval setting, and some don't.

My first attempt was this:

    augeas{'sshd-config-client-alive-interval':
      context => '/files/etc/ssh/sshd_config',
      changes => [
        'ins ClientAliveInterval before Match',
        'set ClientAliveInterval 3600',
      ],
      onlyif => [
        'match ClientAliveInterval size == 0',
        'match Match size > 0',
      ],
    }

But it's not checking both onlyif requirements before trying to add the new setting. Reversing the order tries to add it to configs with the option already set which also causes a failure.


I've read a few posts that suggest putting both match requirements into one setting, but I can't get the syntax right.

    augeas{'sshd-config-client-alive-interval':
      context => '/files/etc/ssh/sshd_config',
      changes => [
        'ins ClientAliveInterval before Match',
        'set ClientAliveInterval 3600',
      ],
      onlyif => [
'match "/files/etc/ssh/sshd_config[(match /files/etc/ssh/sshd_config include ClientAliveInterval) size == 0 and (match /files/etc/ssh/sshd_config include Match) size > 0]" size > 0',
      ],
    }

Any help, suggestions, alternatives would be greatly appreciated.

Using augeas 1.0.0 from scientific linux 6, puppet 2.7.

Thanks!
--
Postgresql & php tutorials
http://www.designmagick.com/

--
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/543745AC.80108%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to