Shareable, portable mini puppet to go!
Branch: production
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
hieradata
hooks
manifests
provision
reference
site
.gitignore
Puppetfile
Readme.md
Vagrantfile
environment.conf
hiera.yaml

Readme.md

Puppet Control Repo

Overview

This is an all-in-one repo that is a skeleton to use in a production environment, but also can be used to share and test Puppet infrastructure.

The idea is that this environment controls all of your environments (dev, qa, production) but also holds the ability to spin up Vagrant VMs to test your code before committing.

NOTE: Internet access is required for this environment

Files/Directories

Vagrantfile

Dictates basics of how Vagrant will spin up VM. Please do not edit this file unless you really know what you're doing.

Puppetfile

r10k needs this file to figure out what component modules you want from the Forge. The result is a modules directory containing all the modules specified in this file, for each environment/branch. The modules directory is listed in environment.conf's modulepath.

environment.conf

Controls puppet's directory environment settings.

Config Files: environment.conf

hieradata

Contains your hiera data files.

manifests

Contains site.pp

site

Contains your organization-specific roles and profiles (wrapper modules for Forge component modules)

This directory is specified as a modulepath in environment.conf

The origins of roles and profiles

hooks/

Git hooks for checking your Puppet code. There is a pre-commit you can copy to your .git/hooks repo directory. There is also a pre-receive for your git server (you also need to copy the commit_hooks subdirectory to your git server). You must install puppet and puppet-lint (locally for pre-commit, on the git server for pre-receive) to use these hooks.

To use the pre-receive hook on your Git server, copy the hook and the commit_hooks directory to the puppet-control.git directory in your repositories directory.

provision/

Contains the scripts and files that are used to spin up the Vagrant VM. This is different from the Vagrantfile in that these are more specific to what you want to happen with the specific instance. The pe/ directory contains answer files, and, after you spin up PE for the first time, will contain PE installation media, which are in .gitignore.

If you want to avoid having to wait for PE to download during the provisioning process and you have the Puppet Enterprise tarball lying around, just copy it over to provision/pe and that step will be skipped.

The provision/provision.sh script contains the PE version that will be installed. You'll need to change it to downgrade/upgrade as needed.

reference/

Reference materials for Puppet workflow.

config/

Contains configuration options to customize oscar.

How to use it

There are three vagrant nodes - PE master, PE agent, and a standalone masterless puppet agent.

The default credentials for the PE Master Console are:

Username: admin

Password: puppetlabs

Summary of procedure

vagrant up <node>

This will take some time to provision.

Ensure that the PE master is up and provisioned before attempting to start another system.

Stuff included:

  • Puppet Environments (control repository)
  • Roles and Profiles
  • Hiera
  • Git workflow

Once everything is provisioned as you need it, you can ssh into the instance:

vagrant ssh master

You will be logged in as user vagrant. Please sudo to root if you need to run puppet.

1. Install Virtualbox

Latest version works fine

2. Install Vagrant

Latest version is fine

3. Install oscar plugin

vagrant plugin install oscar

TO DO

  • Use /vagrant mounted directory on PE master as an environment directory for better full-stack testing
  • Integrate control-spec-helper for testing
  • Develop spec/smoke tests