• Stars
    star
    219
  • Rank 181,133 (Top 4 %)
  • Language
    Puppet
  • License
    MIT License
  • Created over 12 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Vagrant-based Puppet development environment for creating new modules

Description

Puppet Sandbox is a multi-VM Vagrant-based Puppet development environment used for creating and testing new modules outside of your production environment. It is prefered over the upstream Learning Puppet VM as it gives you more flexibility and allows you to use your own local editing environment and tools.

Puppet Sandbox will set up three separate virtual machines:

  • puppet.example.com - the Puppet master server
  • client1.example.com - the first Puppet client machine
  • client2.example.com - the second Puppet client machine

These VMs can be used in conjunction to segregate and test your modules based on node roles, Puppet environments, etc. You can even test modules on different Linux distributions or release versions to better match your production infrastructure.

Check out the Puppet Sandbox Demonstration screencast for a brief overview of the project.

Requirements

To use Puppet Sandbox, you must have the following items installed and working:

Puppet Sandbox has been designed for and tested with Vagrant base boxes running:

  • CentOS 6.3
  • CentOS 5.8
  • Ubuntu 12.04 - Precise Pangolin
  • Ubuntu 10.04 - Lucid Lynx

...although it may work just fine with other distributions/versions.

Usage

Make sure you have a compatible Vagrant base box (if you don't have one already, it will download a 64-bit Ubuntu 12.04 box for you), and then you should be good to clone this repo and go:

$ vagrant box list
precise64
$ git clone git://github.com/elasticdog/puppet-sandbox.git
$ cd puppet-sandbox/

If you want a CentOS base box to work from, I highly recommend the boxes published by Jan Vansteenkiste: http://packages.vstone.eu/vagrant-boxes/

Initial Startup

To bring up the Puppet Sandbox environment, issue the following command:

$ vagrant up

The following tasks will be handled automatically:

  1. The Puppet server daemon will be installed and enabled on the master machine.
  2. The Puppet client agent will be installed and enabled on all three machines.
  3. A host-only network will be set up with all machines knowing how to communicate with each other.
  4. All client certificate requests will be automatically signed by the master server.
  5. The master server will utilize the nodes.pp file and modules/ directory that exist outside of the VMs (in your puppet-sandbox Git working directory) by utilizing VirtualBox's shared folder feature.

All of this is handled using Vagrant's provisioning capabilities and is controlled by the manifests under the provision/ directory. In theory, you should never have to touch any of that code directly unless you're working to improve Puppet Sandbox.

If you wish to change the domain name of the VMs (it defaults to example.com), edit the "domain" variable at the top of Vagrantfile and reload the machines:

$ vim Vagrantfile
$ vagrant reload

Developing New Modules

To start developing a new Puppet module, just create the standard module structure under modules/ in your puppet-sandbox Git working directory (an example "helloworld" module should exist there already). This directory is automatically in the Puppet master server's modulepath, and any changes will be picked up immediately.

$ mkdir -p modules/users/manifests
$ vim modules/users/manifests/init.pp

To have your module actually applied to one or more of the nodes, edit the nodes.pp file and include your classes...that's it!

Check Your Handiwork

To log on to the virtual machines and see the result of your applied Puppet modules, just use standard Vagrant Multi-VM Environment commands, and provide the proper VM name (master, client1, or client2):

$ vagrant ssh client1

If you don't want to wait for the standard 30-minutes between Puppet runs by the agent daemon, you can easily force a manual run:

[vagrant@client1 ~]$ sudo puppet agent --test

License

Puppet Sandbox is provided under the terms of The MIT License.

Copyright ยฉ 2012, Aaron Bull Schaefer.

More Repositories

1

transcrypt

transparently encrypt files within a git repository
Shell
1,467
star
2

packer-arch

packer.io template for building an Arch Linux base box
Shell
284
star
3

genhost

generate unused hostnames by randomly picking from a word list
Shell
257
star
4

salt-sandbox

A Vagrant-based Salt development environment for creating new modules
Puppet
121
star
5

tiddlywiki-docker

Tools for running TiddlyWiki via a Docker container
Shell
42
star
6

yawl

Yet Another Word List (YAWL) by M. Leo Cooper
C
35
star
7

dotfiles

collection of home directory configuration files used across multiple unix-based systems
Shell
28
star
8

hyperboriarch

Ansible playbooks for configuring cjdns nodes running on Arch Linux
Shell
28
star
9

monarch

Ansible playbooks for configuring your own mail server on Arch Linux
16
star
10

vagrant-init

a template for provisioning new Vagrant projects
Ruby
8
star
11

spellabc

Converts characters into their equivalent spelling alphabet code words
Go
7
star
12

matasano-elixir

solutions to the matasano crypto challenges, written in elixir
Elixir
5
star
13

pygments-factor

pygment's lexer for factor language syntax highlighting
Python
2
star
14

lexibomb

a tile-based word game, written in elixir
Elixir
2
star
15

elasticdog-com

The source of my personal website
TypeScript
2
star
16

hello-sinatra

A barebones Sinatra application template using Slim, Compass, and MiniTest::Spec
Ruby
2
star
17

socket_address

An Elixir convenience library for manipulating Internet socket addresses.
Elixir
2
star
18

chef-repo

chef repository integrated with the opscode platform
Ruby
2
star
19

snowflakes

beautiful and unique snowflakes
Nix
1
star
20

actions-sandbox

Sandbox for Configuring GitHub Actions
Rust
1
star
21

miscellaneous-scripts

the name says it all
Shell
1
star
22

taxonate

Identify and filter files based on their programming language.
Rust
1
star