So, I've revisited my entire Puppet bootstrapping routine recently and I have come across some minor and major flaws. I have essentially created a Bash bootstrapping script for the Agent. During which they check for hostname and domain name integrity, the ability to ping the Master, install the Puppetlabs repo, install the Puppet agent, stop the service, run the agent for the first time, prompt to sign the cert on the master, and eventually run the agent again to commit the changes to the node.
So far this has been working great. I've had to modify the script a few times to produce the correct result (for multiple environments), especially if the hostname is misconfigured.
The issue I'm running into now is that I'm now using the example42/puppet-puppet module to configure the nodes to use Puppet. This seems to work okay with the Agents. But I'm having some trouble with the Puppet Master.
So let's assume that you have a completely functional Puppet configuration stored in a GitHub repo, for example. Your Puppet Master node crashes and you need to rebuild it (or rebuild it for fun). My Puppet Master configuration is the entire /etc/puppet directory, including the puppet.conf, auth.conf, fileserver.conf, nodes.pp, site.pp, etc for the master. I'm running into the issue where I need the correct conf files in place before running the agent on the master. I can't do that without first having the conf files generated from the puppet module and committed in my Puppet Master repo and cloned/pulled into /etc/puppet. I'm running into a "chicken before the egg" scenario.
My question to you all is, assuming the Master config repo, how do you, personally, configure the Master's Puppet config with the said repo, before actually using the repo as the Master's config? If not in /etc/puppet, where do you store the Master repo and what initial changes do you make to the config for this to work?
Let me know if you have any questions or if anything needs cleared up. Thanks in advance.
-Dan