Search code examples
apachepuppettheforeman

Puppet removes Foreman VirtualHosts when installing OpenStack


My introduction to Puppet and Foreman has been very painful, but I know there's a big community around it, so I'm hoping that someone can set me straight here.

I set up Foreman and Puppet using the Foreman-Installer and it went great. I had Foreman up and running and it worked great! However, I added the OpenStack controller role to the machine, it wiped out the Apache vhosts for Foreman. I've scoured Google and Github for copies of the vhost files, but with no luck.

So the main questions here: 1) How do I locate/generate the Foreman vhosts for Apache? 2) How do I prevent Puppet from removing them again?

Thanks in advance all you Puppet Masters!


Solution

  • To prevent Puppet from blasting your Apache config, start managing that config through Puppet.

    I'm not sure how your OpenStack controller role works, but it likely employs the puppetlabs-apache module, which will purge unmanaged configuration. You should use this module to configure the Foreman vhost on the machine.

    As for getting it back - Puppet should have stored the contents of deleted files in the clientbucket. Check the logs on that machine. There should be md5 sums for all removed files. Use those to retrieve the contents, either through the filebucket tool, or by manually trudging /var/lib/puppet/clientbucket (or whatever puppet agent --configprint clientbucketdir yields).