Puppet and Vagrant setup

Published by Frank Solli on

Puppet and Vagrant

Frank Solli

This one is pretty simple and gives a lot in return, When doing big changes (and minor ones, really) I can quickly see how the changes will affect production hosts.

Generate a new host certificate on the server or locally, sign it, and place it in puppet_ssl directory.

Place your config file, and type in vagrant –provision, voila.

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "precise64"
config.vm.hostname = "vagrant.frank.local"

config.vm.box_url = ""

config.vm.synced_folder "./puppet_ssl", "/vagrant/puppet_ssl"

config.vm.provision "shell",
  inline: "
    mkdir -p /etc/puppet/ssl/certs;
    mkdir -p /etc/puppet/ssl/private_keys;
    cp /vagrant/puppet_ssl/certs/* /etc/puppet/ssl/certs;
    cp /vagrant/puppet_ssl/private_keys/* /etc/puppet/ssl/private_keys
    apt-get update
    apt-get -y install python-software-properties
    apt-add-repository -y ppa:brightbox/ruby-ng
    dpkg -i puppetlabs-release-precise.deb
    rm puppetlabs-release-precise.deb
    apt-get -qq update
    apt-get -y install ruby1.9.3 puppet libaugeas-ruby1.9.1"

config.vm.provision "puppet_server" do |puppet|
        puppet.puppet_server = ""
        puppet.puppet_node = "vagrant.frank.local"
        puppet.options = "--no-daemonize --pluginsync --onetime --verbose --environment=refactor"


Tags: puppetvagrant.