Skip to content

Instantly share code, notes, and snippets.

@jaytaph
Created October 14, 2012 08:04
Show Gist options
  • Save jaytaph/3887842 to your computer and use it in GitHub Desktop.
Save jaytaph/3887842 to your computer and use it in GitHub Desktop.
Multi VM with puppet master and 2 nodes
Simple multiVM system for 1 puppetmaster and 2 puppet nodes (not configured).
Uses a simple site.pp file as a provisioner that sets the /etc/host with the correct IP's of the virtualboxes.
node base {
host { "puppetmaster" :
ensure => present,
ip => "33.33.33.100",
name => "puppetmaster.workshop.ta",
}
host { "node1" :
ensure => present,
ip => "33.33.33.101",
name => "node1.workshop.ta",
}
host { "node2" :
ensure => present,
ip => "33.33.33.102",
name => "node2.workshop.ta",
}
}
node puppetmaster inherits base {
# Stuff done only on the puppet master
}
node node1 inherits base {
# Stuff done only on node 1
}
node node2 inherits base {
# Stuff only done on node2
}
Vagrant::Config.run do |config|
config.vm.box = 'centos-63-32bit-puppet'
config.vm.box_url = 'https://dl.dropbox.com/sh/9rldlpj3cmdtntc/chqwU6EYaZ/centos-63-32bit-puppet.box'
config.vm.boot_mode = :headless
config.vm.define :master do |master_config|
master_config.vm.host_name = 'puppetmaster.workshop.ta'
master_config.vm.network :hostonly, "33.33.33.100"
master_config.vm.provision :puppet do |puppet|
puppet.manifests_path = "."
puppet.manifest_file = "site.pp"
puppet.options = [ '--verbose', ]
end
end
config.vm.define :node1 do |node1_config|
node1_config.vm.host_name = 'node1.workshop.ta'
node1_config.vm.network :hostonly, "33.33.33.101"
node1_config.vm.provision :puppet do |puppet|
puppet.manifests_path = "."
puppet.manifest_file = "site.pp"
puppet.options = [ '--verbose', ]
end
end
config.vm.define :node2 do |node2_config|
node2_config.vm.host_name = 'node2.workshop.ta'
node2_config.vm.network :hostonly, "33.33.33.102"
node2_config.vm.provision :puppet do |puppet|
puppet.manifests_path = "."
puppet.manifest_file = "site.pp"
puppet.options = [ '--verbose', ]
end
end
end
@Ocramius
Copy link

@jaytaph don't forget the trailing .box :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment