Vhost Lookup Table

asked 2014-05-09 04:46:57 -0500

geek876 gravatar image

Dear All,

I am currently working on auto deploying our apache based app tier via Puppet. The flow is standard whereby the node classifies itself (external facts) as a webserver and puppet applies the apache class which simply installs the httpd service. There are few vhosts and I have httpd.conf and vhost config files coming from apache module's files.

Now the issue is that each of these 25+ vhosts, maps to a separate SVN repo. The name of the vhost file within apache and the SVN repo name are not same (Vhost could be called as abc.mydomain.com.conf and the SVN repo that has its codeset could be called as pqr for example. Obviously the SVN repo info is not stored within the Vhost config file.

I want to automate the checkout of vhost document root from SVN via puppet. How best shall I achieve this ? Shall I use some kind of lookup within Hiera ( vhost : SVN_repo key value pairs ?) . So my puppet apache class then looks up the table and then goes through checking out after installing the package to create all the Vhosts docroots ?

Also, my ultimate aim is that this should be as much automated and easy to maintain in future. So say if we have a new vhost to be added in future, ideally i don't want to change the puppet code and want to drive the change via Hiera or something similar.

Any advice much appreciated.

Thanks.

edit retag flag offensive close merge delete