Skip to content

stexads/puppet-playground

Repository files navigation

Puppet Playground

Latest Puppet playground (for your tests and developement) that just works!

This is work based on voxpupuli's Crafty oss Example

Clone the repository

Navigate to the chosen directory and clone the repository with:

git clone git@github.com:stexads/puppet-playground.git

The rest of this document assumes will list a series of commands that should be typed from inside the cloned repository. For example:

mkdir ~/sandbox
cd ~/sandbox
git clone git@github.com:stexads/puppet-playground.git
cd puppet-playground

Start basic Playground setup

podman compose --profile play up

Stop basic Playground setup

podman compose --profile play down -v

Puppetboard

Open up: http://127.0.0.1:8088/

Puppetserver

To login the puppetserver:

podman exec -it puppetserver bash

Test an agent

Generic agent (no systemd)

When the play profile is up and healthy, start a generic agent (no systemd):

podman run --rm --hostname puppet-agent --network 0x3e.lan -it ghcr.io/exogroup/generic/el9:latest /bin/bash

Using the test profile (note: this option has not been tested):

podman compose --profile test run testing agent -t

Agent with systemd

First spin up a systemd-based image like el9 with the following command:

podman run --privileged --rm --name agent --hostname agent.0x3e.lan --network 0x3e.lan -it ghcr.io/exogroup/generic/el9:latest /sbin/init

Then, by using a seperate tty, login to the image:

podman exec -it agent bash

This will open up a shell in the agent. Next we need to install puppet as the image does not come with puppet installed:

apt update && apt install -y puppet

Connect agent to puppetserver.

Finally we can connect the agent to the puppetserver:

puppet agent -tv

Start HDM (Hiera Data Manager)

podman compose --profile hdm up -d

then open up: http://0.0.0.0:3000/

cleanup

podman compose --profile play down
podman compose --profile hdm down
podman compose --profile test down

podman volume rm oss_openvoxserver
podman volume rm oss_openvoxserver-ssl
podman volume rm oss_openvoxserver-ca
podman volume rm oss_openvoxdb
podman volume rm oss_openvoxdb-postgres
podman volume rm oss_agent-ssl

podman network rm 0x3e.lan

Troubleshooting

Certificate error

You might get the following error at some stage:

Error: certificate verify failed [unable to get local issuer certificate for CN=puppet]

Steps to resolve: On puppetserver:

puppetserver ca list --all
puppetserver ca clean --certname <agent-node-certname>

On puppet agent:

sudo rm -rf /etc/puppetlabs/puppet/ssl
puppet agent -tv

About

Puppet basic environment based on Openvox example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors