add run_mode config param

this adds additional vagrant config that can be
used to determine if a host should run its site
manifest via puppet apply, or as a puppet agent
run.

This config is set per host and default to apply
mode.
This commit is contained in:
Dan Bode
2013-01-11 11:02:51 -08:00
parent 8acf679a3f
commit 18808ed3c7

20
Vagrantfile vendored
View File

@@ -171,6 +171,26 @@ Vagrant::Config.run do |config|
puppet.module_path = 'modules'
#puppet.options = ['--verbose', '--show_diff', "--certname=#{node_name}"]
puppet.options = ["--certname=#{node_name}"]
run_mode = props['run_mode'] || :apply
if run_mode == :apply
agent.vm.provision(:puppet, :pp_path => "/etc/puppet") do |puppet|
puppet.manifests_path = 'manifests'
puppet.manifest_file = 'site.pp'
puppet.module_path = 'modules'
puppet.options = puppet_options
end
elsif run_mode == :agent
agent.vm.provision(:puppet_server) do |puppet|
puppet.puppet_server = 'puppetmaster.puppetlabs.lan'
puppet.options = puppet_options + ['-t', '--pluginsync']
end
else
puts "Found unexpected run_mode #{run_mode}"
end
end
end