> Can you please explain this method a bit more, for the
> unexperienced like me?
>
> Showing the actual code would be great, if it's possible.

Sure, I assume you mean the exported resource part. Using
storeconfigs[1] it's possible to exchange information between nodes.
Brice has some great explanations on his blog[2]. This example, using
concat[3] should give you an idea:

class dns::resolver {
 # create a file fragment pointing to this node
 @@concat::fragment{
  "resolv.conf_${fqdn}":
   target => "/etc/resolv.conf",
   order => 10,
   content => "nameserver\t$ipaddress\t# $fqdn\n",
   tag => $location;
 }
}

class dns::client {
 # concat teh fragments into the target file
 concat{"/etc/resolv.conf": }
 # insert a local fragment with search domain
 concat_fragment{
  "resolv.conf_search":
   target => "/etc/resolv.conf",
   order => 05,
   content => "search\tdomain.com\n"
 }
 # "realize" (retrieve) Concat_fragment resources provided by other
nodes in the same $location
 Concat_fragment <<| tag = $location |>>
}

I also tested using native types like Host and Augeas. Both worked
fine as far as I could see. For resources like /etc/resolv.conf you
may want to include a safe default entry in dns::client. That could
help protect against no available dns::resolver nodes, for example.

[1] 
http://projects.reductivelabs.com/projects/puppet/wiki/Using_Stored_Configuration
[2] http://www.masterzen.fr/2009/08/08/storeconfigs-use-cases/
[3] 
http://www.devco.net/archives/2010/02/19/building_files_from_fragments_with_puppet.php

-- 
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