0

I try to create a new entry in hosts.allow

 augeas { "Add in hosts allow" : 
        context => '/files/etc/hosts.allow',
        changes => [
        'ins 01 after *[last()]',
        'set 01/process[1] ssh',
        'set 01/process[2] ssh2',
        'set 01/client ipaddr'
      ],
  }

But it doesn't work I get this error

Notice: Compiled catalog for server.local in environment production in 0.96 seconds
Error: /Stage[main]/Nfs::Server/Augeas[Add in hosts allow]: Could not evaluate: Error sending    
command 'ins' with params ["01", "after", "/files/etc/hosts.allow/*[last()]"]/Error sending 
command 'ins' with params ["01", "after", "/files/etc/hosts.allow/*[last()]"]

I can't see how to use the ins command, the message don't let me know what's went wrong.

CentOS6.4

Puppet version: 3.3.1

augeasversion (from facter): 0.9.0

I Can't find the version of augtools and I can't either execute a command as it is not installed (I don't know how puppet invoke it)

Michael Courcy
  • 627
  • 2
  • 6
  • 13

1 Answers1

1

Try adding a leading "/" to the context?

(The logging is slightly odd, it doesn't show the "files" prefix at all, I wonder if your code sample and logging match.)

Dominic Cleal
  • 3,205
  • 19
  • 22