Puppet Docker image and configuration (manifests) to run a CoreOS cluster, EPFL-STI style
Docker registry: https://registry.hub.docker.com/u/epflsti/puppet/
cluster.coreos.puppet inside the cluster.foreman Docker container:
docker exec -it puppetmaster.mysubdomain.mydomain.com /bin/bash
cd /etc/puppet/environments/production/modules
git clone https://github.com/epfl-sti/cluster.coreos.puppet.git epflsti_coreosBuild the Puppet agent image with Docker:
docker build -t epflsti/puppet .
Upload the image:
docker push epflsti/puppet
At EPFL-STI, we provision bare metal with Foreman. We are currently infatuated with CoreOS, which has its cloud-config.yaml system, but even they say right there in that page that "[i]t is not intended to be a Chef/Puppet replacement".
In our CoreOS clusters, Puppet + Foreman integration provides us with the following benefits:
dmidecoded serial numbers) into Foreman's centralized databaseTo run Puppet on CoreOS, we rely on two Docker images:
cluster.foreman
project,puppet-agent/Dockerfile in this project).As is customary for a number of CoreOS services, the Docker container
for the Puppet agent is run as a systemd service, and both the
container and the service are named identically (puppet.service).
In the standard deployment scenario,
cluster.foreman and
cluster.coreos.install
cooperate to run the Dockerized Puppet agent a first time after CoreOS
is installed on the node being provisioned, and before it reboots. At
this stage, Puppet is responsible for installing itself into the
on-disk system image so that it operates normally after reboot.
In order for the Puppet code to to distinguish the bootstrap and
steady-state stages, Puppet is passed an environment variable
FACTER_lifecycle_stage=bootstrap, which translates to
$::lifecycle_stage == "bootstrap" in the code. Puppet arranges to
run itself with FACTER_lifecycle_stage=production after reboot.
This two-stage setup is made necessary by the fact that before rebooting, the provisioning host needs to transition from the "building" to "built" states in Foreman; this is so that even if the BIOS is still configured to boot through PXE, the pxelinux configuration on Foreman's TFTP server will instruct the provisioned host to boot from the local disk.
Not all Puppet classes are aware of $::lifecycle_stage; for those
that aren't, manifests/init.pp simply excludes them at bootstrap
time. See the comments at the top of the individual manifests/*.pp
files for more details.
Content type
Image
Digest
sha256:dc9067e93…
Size
18.1 MB
Last updated
over 9 years ago
docker pull epflsti/cluster.coreos.puppet