diff --git a/CHANGELOG.md b/CHANGELOG.md index fdce1283c..95e26ff41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ IMPROVEMENTS: - Remote commands that fail will now show the stdout/stderr of the command that failed. [GH-1203] + - Puppet will run without color if the UI is not colored. [GH-1344] BUG FIXES: diff --git a/plugins/provisioners/puppet/provisioner/puppet.rb b/plugins/provisioners/puppet/provisioner/puppet.rb index 485abd7bb..522a75245 100644 --- a/plugins/provisioners/puppet/provisioner/puppet.rb +++ b/plugins/provisioners/puppet/provisioner/puppet.rb @@ -97,6 +97,10 @@ module VagrantPlugins options << "--hiera_config=#{@hiera_config_path}" end + if !@machine.env.ui.is_a?(Vagrant::UI::Colored) + options << "--no-color" + end + options << "--detailed-exitcodes" options << @manifest_file options = options.join(" ") diff --git a/plugins/provisioners/puppet/provisioner/puppet_server.rb b/plugins/provisioners/puppet/provisioner/puppet_server.rb index 53ec81026..c7d2fdf10 100644 --- a/plugins/provisioners/puppet/provisioner/puppet_server.rb +++ b/plugins/provisioners/puppet/provisioner/puppet_server.rb @@ -40,6 +40,12 @@ module VagrantPlugins # Add the certname option if there is one options += ["--certname", cn] if cn + + # Disable colors if we must + if !@machine.env.ui.is_a?(Vagrant::UI::Colored) + options << "--no-color" + end + options = options.join(" ") # Build up the custom facts if we have any