Skip to content

Instantly share code, notes, and snippets.

@njhowell
Created August 6, 2015 20:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save njhowell/0dc3a1f8c680ea0b969c to your computer and use it in GitHub Desktop.
Save njhowell/0dc3a1f8c680ea0b969c to your computer and use it in GitHub Desktop.
Vagrant config for Puppet master
node default {
package {'puppetserver':
ensure => latest,
}
->
package {'ruby-dev':
ensure => latest,
}
package {'r10k':
ensure => latest,
provider => 'gem',
require => Package['ruby-dev'],
}
}
#!/usr/bin/env bash
#
# This bootstraps Puppet on Ubuntu 14.04 LTS.
#
REPO_DEB_URL="http://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb"
# Install the PuppetLabs repo
echo "Configuring PuppetLabs repo..."
repo_deb_path=$(mktemp)
wget --output-document=${repo_deb_path} ${REPO_DEB_URL}
dpkg -i ${repo_deb_path}
apt-get update
# Remove Puppet if it's there already
apt-get remove -y puppet
apt-get autoremove -y
rm -rf /var/lib/puppet/ssl/certs/*
apt-get install -y puppet-agent
echo "export PATH=$PATH:/opt/puppetlabs/bin" >> /etc/profile
export PATH=$PATH:/opt/puppetlabs/bin
/opt/puppetlabs/bin/puppet apply /vagrant/puppet/manifests/default.pp --verbose
cp /vagrant/puppet/puppetserver /etc/default/puppetserver
service puppetserver start
cd /etc/puppetlabs/code/environments
r10k puppetfile install
echo "Puppet installed!"
###########################################
# Init settings for puppetserver
###########################################
# Location of your Java binary (version 7 or higher)
JAVA_BIN="/usr/bin/java"
# Modify this if you'd like to change the memory allocation, enable JMX, etc
JAVA_ARGS="-Xms400m -Xmx400m -XX:MaxPermSize=256m"
# These normally shouldn't need to be edited if using OS packages
USER="puppet"
GROUP="puppet"
INSTALL_DIR="/opt/puppetlabs/server/apps/puppetserver"
CONFIG="/etc/puppetlabs/puppetserver/conf.d"
BOOTSTRAP_CONFIG="/etc/puppetlabs/puppetserver/bootstrap.cfg"
SERVICE_STOP_RETRIES=60
# START_TIMEOUT can be set here to alter the default startup timeout in
# seconds. This is used in System-V style init scripts only, and will have no
# effect in systemd.
# START_TIMEOUT=120
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/trusty64"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "public_network"
config.vm.hostname = "puppet"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder "../", "/etc/puppetlabs/code/environments/production"
config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM:
vb.memory = "512"
end
config.vm.provision "shell", inline: <<-SHELL
sudo /vagrant/puppet/provision_puppetmaster.sh
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment