diff --git a/CHANGELOG.md b/CHANGELOG.md index 609908257..0a665d5c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## 1.1.3 (unreleased) +IMPROVEMENTS: + + - Puppet apply provisioner now retains the default module path + even while specifying custom module paths. [GH-1207] + BUG FIXES: - Attempt to re-establish SSH connection on `Net::SSH::Disconnect` diff --git a/plugins/provisioners/puppet/provisioner/puppet.rb b/plugins/provisioners/puppet/provisioner/puppet.rb index 5133ae318..386ee5263 100644 --- a/plugins/provisioners/puppet/provisioner/puppet.rb +++ b/plugins/provisioners/puppet/provisioner/puppet.rb @@ -70,7 +70,14 @@ module VagrantPlugins def run_puppet_apply options = [config.options].flatten module_paths = @module_paths.map { |_, to| to } - options << "--modulepath '#{module_paths.join(':')}'" if !@module_paths.empty? + if !@module_paths.empty? + # Prepend the default module path + module_paths.unshift("/etc/puppet/modules") + + # Add the command line switch to add the module path + options << "--modulepath '#{module_paths.join(':')}'" + end + options << @manifest_file options = options.join(" ")