On Wed, Sep 8, 2010 at 7:39 AM, hai wu <haiwu...@gmail.com> wrote:

> This one is different from examples on that page, in that file
> /etc/securetty is not name value pair, it just has values in it. I used the
> following as the workaround:
>
>                 augeas { "securetty":
>                         context => "/files/etc/securetty",
>                         changes => [
>                                 "set *[.='tty9'] ttyS1",
>                         ],
>                         onlyif => "match ttyS1 size == 0",
>                 }
>
>
You can use combination of ins and set to inject at the beginning of the
file since this file is not a key/value pair like most augeas managed files:

augeas { "foo":
  context => "/files/etc/securetty",
  changes => [ "ins 0 before /files/etc/securetty/1",
               "set /files/etc/securetty/0 ttyS1",
             ],
  onlyif  => "match *[.='ttyS1'] size == 0",
}

Thanks,

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to