Skip to content

pozgo/docker-puppet-server

Repository files navigation

Puppet Server in docker with r10k and auto-sync

Build Status
GitHub Open Issues
Stars Fork
Docker Start Docker Pulls Docker Auto

Felling like supporting me in my projects use donate button. Thank You!

This is Docker Image with Puppet Server and r10k module with auto-sync.

User can specify private repository with environments used by r10k using provided variable. Please read below.

Environmental variables

Variable Dexcription Example
ENVIRONMENTS_REPO_ADDRESS Repository containing environments for puppet server. 1 ssh://git@my-repo.git.my.domain.com/puppet/environments.git
SYNC_INTERVAL How often r10k should sync with repository. Defualt set to every minute. Cron based format * * * * *
AUTO_SIGN_DOMAIMN Domain name from which puppet will autosign nodes *.domain.com,domain.com2

1 More details on how to prepare such repository here. If specified private repository user need to provide private key that need to be shared with the image. -v /my_key:/root/.ssh/id_rsa

2 Comma separated domain names.

Usage

Basic

docker run \
    -d \
    --name puppet-server \
    -p 8140:8140 \
    polinux/puppet-server

This wil spin up just base puppet server same as using offcial image

Start with custom repository and certain domain name

docker run \
    -d \
    --name puppet-server \
    -p 8140:8140 \
    -v /path/to/private/key:/root/.ssh/id_rsa \
    -e ENVIRONMENTS_REPO_ADDRESS='' \
    -e AUTO_SIGN_DOMAIMN='*.domain.com' \
    polinux/puppet-server

Share ssl keys and modules with environments on host OS

docker run -d \
    -- name puppet-server \
    -p 8140:8140 \
    -v /path/to/private/key:/root/.ssh/id_rsa \
    -e ENVIRONMENTS_REPO_ADDRESS='' \
    -e AUTO_SIGN_DOMAIMN='*.domain.com' \
    -v host/os/dir/ssl:/etc/puppetlabs/puppet/ssl \
    -v -v host/os/dir/code:/etc/puppetlabs/code \
      polinux/puppet-server

Build

docker build -t polinux/puppet-server .

Docker troubleshooting

Use docker command to see if all required containers are up and running:

$ docker ps

Check logs of puppet-server server container:

$ docker logs puppet-server

Sometimes you might just want to review how things are deployed inside a running container, you can do this by executing a bash shell through docker's exec command:

docker exec -ti puppet-server /bin/bash

History of an image and size of layers:

docker history --no-trunc=true polinux/puppet-server | tr -s ' ' | tail -n+2 | awk -F " ago " '{print $2}'

Author

Przemyslaw Ozgo (linux@ozgo.info)


This Work was infulenced by official Puppet standalone image just build the way it should be. :) Thanks guys for the inspiration!