Something else first

I've implemented HTTPS to the site, using Let's Encrypt. :)

The problem that I'm facing

I love cloud-init and the idea of bootstrapping a node with a small config at it's first stage. But there are some issues. It's actually not really cloud-inits fault either. It's a combo of the cloud-init puppet module and the apt/yum repos that have super old package content.

The issue that I have is that there is an old version of Puppet on the public apt/yum repos, and the cloud-init module for configuring puppet is using the old package name: "puppet". So regardless if I tell cloud-init or not, to configure PuppetLabs repo it will still install the old version of the software. Only because it's named: "puppet-agent" in the PuppetLabs repo.

So how did I solved it?

I have written a simple bash script that cloud-init executes. Then the bash script does the following things:

  • Downloads the PuppetLabs repo configuration and implement it.
  • Run a repo update and install "puppet-agent"
  • Clone my "node-bootstrap" repo on git
  • Install a puppet module from puppet forge
  • Do a puppet apply based on my bootstrap.pp file which contain configuration parameters for the "puppet-agent"

I also published it on GitHub: https://github.com/linpopilan/node-bootstrap