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:
20
Vagrantfile
vendored
20
Vagrantfile
vendored
@@ -171,6 +171,26 @@ Vagrant::Config.run do |config|
|
|||||||
puppet.module_path = 'modules'
|
puppet.module_path = 'modules'
|
||||||
#puppet.options = ['--verbose', '--show_diff', "--certname=#{node_name}"]
|
#puppet.options = ['--verbose', '--show_diff', "--certname=#{node_name}"]
|
||||||
puppet.options = ["--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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user