Created
November 16, 2012 19:42
-
-
Save fnichol/4090228 to your computer and use it in GitHub Desktop.
A Puppet Master!
This file contains hidden or 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
site :opscode | |
# i heard you liked puppet | |
cookbook 'puppet' |
This file contains hidden or 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
require 'berkshelf/vagrant' | |
def oc_box_url(name) | |
"https://opscode-vm.s3.amazonaws.com/vagrant/boxes/#{name}.box" | |
end | |
def puppetmaster_ip | |
"172.16.33.31" | |
end | |
Vagrant::Config.run do |config| | |
config.vm.define :puppetmaster do |vm_config| | |
vm_config.vm.box = "opscode-ubuntu-12.04" | |
vm_config.vm.box_url = oc_box_url(vm_config.vm.box) | |
vm_config.vm.host_name = "puppetmaster.vagrantup.com" | |
vm_config.vm.network :hostonly, puppetmaster_ip | |
vm_config.vm.provision :chef_solo do |chef| | |
chef.run_list = [ | |
"recipe[puppet::master]" | |
] | |
# normally a terrible thing to do (autosign=true), but only | |
# internally networked nodes will be talking to the server | |
chef.json = { | |
:puppet => { | |
:master_conf => { | |
:master => { | |
:autosign => 'true' | |
} | |
} | |
} | |
} | |
end | |
# set up all puppet nodes to be an apache web server | |
vm_config.vm.provision :shell, :inline => <<-PREPARE_MASTER.gsub(/^ {6}/, '') | |
puppet module install puppetlabs-apache | |
cat <<SITE_PP > /etc/puppet/manifests/site.pp | |
node default { | |
class { 'apache': } | |
} | |
SITE_PP | |
PREPARE_MASTER | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment