From 1da271c53617215c656e145cc7331d68fd6c0b8a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 2 Jan 2014 14:37:47 -0800 Subject: [PATCH] provisioners/puppet: synced_folder_type [GH-2709] --- CHANGELOG.md | 12 ++++++++++++ plugins/provisioners/puppet/config/puppet.rb | 18 +++++++++++++++--- .../provisioners/puppet/provisioner/puppet.rb | 4 ++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 243088e0f..a3da3fa20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,21 @@ ## 1.5.0 (unreleased) +DEPRECATIONS: + + - provisioners/puppet: The "nfs" setting has been replaced by + `synced_folder_type`. The "nfs" setting will be removed in the next + version. + FEATURES: - **New guest:** Funtoo (change host name and networks supported) +IMPROVEMENTS: + + - provisioners/puppet: New config `synced_folder_type` replaces the + `nfs` option. This can be used to set the synced folders the provisioner + needs to any type. [GH-2709] + ## 1.4.3 (January 2, 2014) BUG FIXES: diff --git a/plugins/provisioners/puppet/config/puppet.rb b/plugins/provisioners/puppet/config/puppet.rb index 32498c6e0..c56674a48 100644 --- a/plugins/provisioners/puppet/config/puppet.rb +++ b/plugins/provisioners/puppet/config/puppet.rb @@ -14,7 +14,7 @@ module VagrantPlugins attr_accessor :options attr_accessor :temp_dir attr_accessor :working_directory - attr_accessor :nfs + attr_accessor :synced_folder_type def initialize super @@ -25,9 +25,21 @@ module VagrantPlugins @module_path = UNSET_VALUE @options = [] @facter = {} + @synced_folder_type = UNSET_VALUE @temp_dir = UNSET_VALUE @working_directory = UNSET_VALUE - @nfs = UNSET_VALUE + end + + def nfs=(value) + puts "DEPRECATION: The 'nfs' setting for the Puppet provisioner is" + puts "deprecated. Please use the 'synced_folder_type' setting instead." + puts "The 'nfs' setting will be removed in the next version of Vagrant." + + if value + @synced_folder_type = "nfs" + else + @synced_folder_type = nil + end end def finalize! @@ -46,9 +58,9 @@ 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 + @synced_folder_type = nil if @synced_folder_type == 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 diff --git a/plugins/provisioners/puppet/provisioner/puppet.rb b/plugins/provisioners/puppet/provisioner/puppet.rb index e62e409b5..53d8640a2 100644 --- a/plugins/provisioners/puppet/provisioner/puppet.rb +++ b/plugins/provisioners/puppet/provisioner/puppet.rb @@ -27,8 +27,8 @@ module VagrantPlugins end folder_opts = {} - folder_opts[:nfs] = true if @config.nfs - folder_opts[:owner] = "root" if !folder_opts[:nfs] + folder_opts[:type] = @config.synced_folder_type if @config.synced_folder_type + folder_opts[:owner] = "root" if !@config.synced_folder_type # Share the manifests directory with the guest if @config.manifests_path[0].to_sym == :host