Recently, Puppet added some cool stuff on their Docker hub page. You can now deploy puppetserver, puppetDB, and agents as containers.
Why is this ultracool? Well, I can now bind an awesome container OS like CoreOS to my Puppet Enterprise master and config manage it! That is exactly the super hip thing we are going to do in this blog post.
Installing CoreOS is beyond the scope of this post and there are a lot of good guides out there on the subject. For some guidance, check this doc.
My installation has 3 nodes: coreos01.puppet.xuxo, coreos02.puppet.xuxo, coreos03.puppet.xuxo. So….Let’s begin! As usual, I promise this to be super simple.
Login to each coreOS instance and perform this step:
docker run -v /tmp:/tmp -v /etc:/etc -v /var:/var -v /usr:/usr -v /lib64 /lib64 -d --net=host puppet/puppet-agent-debian agent --verbose --no-daemonize --logdest=console --server=your-master-fqdn --environment=production --summarize
On this command I am using the –net=host argument to use the underlying network and name resolution on the OS. Adjust accordingly.
Wait a minute or two and you will see your coreOS hosts in the Puppet Console. It will also gather facts for the OS and report them:
Finally, we can apply changes to the OS as you are used to with Puppet. As an example, we can modify (or create) /etc/resolv.conf:
Told you it was simple!
This new technique of putting the Puppet agent in a container creates a whole new way of managing newer infrastructures and OSes.
Please visit Gareth Rushgrove examples’ repo for more Puppet Docker fun.
Thanks for reading this post.