Created
August 6, 2015 20:38
-
-
Save njhowell/0dc3a1f8c680ea0b969c to your computer and use it in GitHub Desktop.
Vagrant config for Puppet master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node default { | |
package {'puppetserver': | |
ensure => latest, | |
} | |
-> | |
package {'ruby-dev': | |
ensure => latest, | |
} | |
package {'r10k': | |
ensure => latest, | |
provider => 'gem', | |
require => Package['ruby-dev'], | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################### | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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