From 77da9c8451990e679f5ddcd0cad8e7fc3acb462f Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Thu, 31 Dec 2015 15:53:50 +0200 Subject: [PATCH] Added Puppetmaster testing docker container source --- puppetmaster/.dockerignore | 3 +++ puppetmaster/Dockerfile | 8 ++++++++ puppetmaster/puppet.conf | 33 +++++++++++++++++++++++++++++++++ puppetmaster/run.sh | 13 +++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 puppetmaster/.dockerignore create mode 100644 puppetmaster/Dockerfile create mode 100644 puppetmaster/puppet.conf create mode 100755 puppetmaster/run.sh diff --git a/puppetmaster/.dockerignore b/puppetmaster/.dockerignore new file mode 100644 index 0000000..a877f95 --- /dev/null +++ b/puppetmaster/.dockerignore @@ -0,0 +1,3 @@ +*.swp +.*.swp +run.sh diff --git a/puppetmaster/Dockerfile b/puppetmaster/Dockerfile new file mode 100644 index 0000000..a6e4494 --- /dev/null +++ b/puppetmaster/Dockerfile @@ -0,0 +1,8 @@ +FROM centos:7 +MAINTAINER bkorren@redhat.com +RUN ["yum", "install", "-y", "epel-release", "centos-release-scl"] +RUN ["yum", "install", "-y", "puppet-server"] +COPY puppet.conf /etc/puppet/puppet.conf +EXPOSE 8140 +VOLUME ["/etc/puppet/environments/production"] +ENTRYPOINT ["/usr/bin/puppet", "master", "--no-daemonize", "--logdest", "console"] diff --git a/puppetmaster/puppet.conf b/puppetmaster/puppet.conf new file mode 100644 index 0000000..212c4b6 --- /dev/null +++ b/puppetmaster/puppet.conf @@ -0,0 +1,33 @@ +[main] + # The Puppet log directory. + # The default value is '$vardir/log'. + logdir = /var/log/puppet + + # Where Puppet PID files are kept. + # The default value is '$vardir/run'. + rundir = /var/run/puppet + + # Where SSL certificates are kept. + # The default value is '$confdir/ssl'. + ssldir = $vardir/ssl + +[agent] + # The file in which puppetd stores a list of the classes + # associated with the retrieved configuratiion. Can be loaded in + # the separate ``puppet`` executable using the ``--loadclasses`` + # option. + # The default value is '$confdir/classes.txt'. + classfile = $vardir/classes.txt + + # Where puppetd caches the local configuration. An + # extension indicating the cache format is added automatically. + # The default value is '$confdir/localconfig'. + localconfig = $vardir/localconfig + +[master] + user=root + group=root + autosign = true + dns_alt_names = puppet,puppet.local,puppet.localdomain,puppetmaster,puppetmaster.local,puppetmaster.localdomain + manifest = $confdir/environments/$environment/manifests/site.pp + modulepath = $confdir/environments/$environment/site:$confdir/environments/$environment/modules diff --git a/puppetmaster/run.sh b/puppetmaster/run.sh new file mode 100755 index 0000000..15da002 --- /dev/null +++ b/puppetmaster/run.sh @@ -0,0 +1,13 @@ +#!/bin/bash -x +# puppetmaster/run.sh - Invoke the puppetmaste container mounting the local +# directory as /etc/puppet/environments/production +# +sudo /usr/bin/docker run \ + --hostname puppet.localdomain \ + --name puppetmaster \ + --interactive \ + --tty=true \ + --volume="$PWD":/etc/puppet/environments/production:Z \ + bkorren/puppetmaster \ + "$@" +