Need some assistance with what I believe is a requirement that can be 
solved using Exported Resources (or maybe there is another method which is 
better suited).

I have a module svn::server::init. This module can be called with a 
parameter is_master which defines whether it is a master SVN server or a 
slave SVN system. What I need to be able to do is report back all the nodes 
that are called with is_master = false so that the master is aware of all 
the slaves.

The solution I had some up with was the following:


                if $is_master {
                        File <<| tag == 'svn_slave' |>> { }
                } else {
                        @@file { "$svn::params::c_path/slave.$hostname":
                                content => "hostname = $fqdn\nip = 
$ipaddress\n",
                                tag     => 'svn_slave',
                        }
                }

    
So basically what that does is export a file /etc/subversion/slave.HOSTNAME 
for every client. The master then realizes those and creates a file for 
each client in /etc/subversion. That works pretty well. But my issue is 
that I need to use the hostname/FQDN of each client in a template 
(generating hooks to mirror the repos to each slave that is out there).

Thinking of how to do this I thought well I could write a FACT that then 
parses those /etc/subversion/slave.HOSTNAME files. Is that the best way to 
do that? Or is there a way through exporting a resource that I could get 
the details directly in my manifest? If I wrote a fact to do it I would 
essentially have to run puppet twice in order to spin up a new slave. First 
run would create the /etc/subversion/slave.HOSTNAME file and second run 
that would be included in the fact (first run it wouldn't because the file 
didn't exist yet).

Thanks for your help

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