provisioners/puppet: use unique directory for each definition
This commit is contained in:
parent
f8223d4704
commit
17b68f7d50
|
@ -92,6 +92,8 @@ BUG FIXES:
|
|||
- provisioners/chef: Create/chown the cache and backup folders. [GH-2281]
|
||||
- provisioners/chef: Verify environment paths exist in config
|
||||
validation step. [GH-2381]
|
||||
- provisioners/puppet: Multiple puppet definitions in a Vagrantfile
|
||||
work correctly.
|
||||
- provisioners/salt: Bootstrap on FreeBSD systems work. [GH-2525]
|
||||
- provisioners/salt: Extra args for bootstrap are put in the proper
|
||||
location. [GH-2558]
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
require "vagrant/util/counter"
|
||||
|
||||
module VagrantPlugins
|
||||
module Puppet
|
||||
module Config
|
||||
class Puppet < Vagrant.plugin("2", :config)
|
||||
extend Vagrant::Util::Counter
|
||||
|
||||
attr_accessor :facter
|
||||
attr_accessor :hiera_config_path
|
||||
attr_accessor :manifest_file
|
||||
|
@ -42,9 +46,16 @@ module VagrantPlugins
|
|||
@hiera_config_path = nil if @hiera_config_path == UNSET_VALUE
|
||||
@manifest_file = "default.pp" if @manifest_file == UNSET_VALUE
|
||||
@module_path = nil if @module_path == UNSET_VALUE
|
||||
@temp_dir = "/tmp/vagrant-puppet" if @temp_dir == UNSET_VALUE
|
||||
@temp_dir = nil if @temp_dir == UNSET_VALUE
|
||||
@working_directory = nil if @working_directory == UNSET_VALUE
|
||||
@nfs = false if @nfs == UNSET_VALUE
|
||||
|
||||
# Set a default temp dir that has an increasing counter so
|
||||
# that multiple Puppet definitions won't overwrite each other
|
||||
if !@temp_dir
|
||||
counter = self.class.get_and_update_counter(:puppet_config)
|
||||
@temp_dir = "/tmp/vagrant-puppet-#{counter}"
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the module paths as an array of paths expanded relative to the
|
||||
|
|
Loading…
Reference in New Issue