On Monday, May 19, 2014 2:39:47 AM UTC-5, Grant Street wrote:
>
> Hi 
>
> First time poster to this forum. I'm in the process of doing a pilot to 
> convert a cfengine v2 install to puppet.
>
> I was wondering if any one had any ideas on the following. 
>
> I have machines that can be in any combination(ie 0  or more) of 10 
> groups, that can change. I need to create an access.conf based on the group 
> membership of the node. 
> I would like the file to be dynamically created with any redundant lines 
> removed. 
>
> I have had a look at augeus but  I can't see how to both add lines based 
> on the group as well as remove unwanted and unknown lines. 
> I have also had a look at templates but unsure how that would look like 
> when the you have 0-10 insertion points 
>
>

A template is probably the way to go.  The point to understand there is 
that you will be templating the entire contents of the file, not just the 
lines related to the 10 groups.  Supposing that you have an array of the 
names of the wanted groups, then, your template might look like this:

+:root:LOCAL
<% @wanted_groups.each do |g| -%>
+:(<%= g %>):ALL
<% end -%>
-:ALL:ALL


John

-- 
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/d7a86966-d1c9-4de5-9484-97494f0696d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to