Hi

I am trying to configure hosts.allow using augeas with puppet. I can add a
ip range if process exists with this code

 augeas { "Add ${name} to ${process}":
   context => "/files/etc/hosts.allow",
   changes => "set *[process='${process}']/client[last()+1] ${name}",
   onlyif  => "match *[process='${process}']/client[.='${name}'] size == 0",

but if a process doesn't exist then  I can't do it  dynamically, some thing
like this works

augeas { "Add ${name} - ${process}":
   context => "/files/etc/hosts.allow",
   changes => [ "set 02/process ${process}", "set 02/client[.='{$name}']
${name}" ],
   onlyif  => "match *[process='${process}'] size == 0",
  }

But I have to provide node number (02 here) . The above code is mostly
based on
https://gist.github.com/rodjek/18c50d8800840696bac0

Can some one give a better option. What I want is that I can define
different process and ip range in node manifest file like this

ssh::hosts_allow { [ '1.1.1.1', '2.2.2.2',  ]:
       process => 'sshd',

ssh::hosts_allow { [ '3.3.3.3 ]:
       process => 'nrpe',

Thanks
Kashif

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to