diff options
-rw-r--r-- | lib/chef/resource/windows_ad_join.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/chef/resource/windows_ad_join.rb b/lib/chef/resource/windows_ad_join.rb index b3acacc703..50e71ef362 100644 --- a/lib/chef/resource/windows_ad_join.rb +++ b/lib/chef/resource/windows_ad_join.rb @@ -73,7 +73,13 @@ class Chef converge_by("join Active Directory domain #{new_resource.domain_name}") do ps_run = powershell_out(cmd) - raise "Failed to join the domain #{new_resource.domain_name}: #{ps_run.stderr}}" if ps_run.error? + if ps_run.error? + if sensitive? + raise "Failed to join the domain #{new_resource.domain_name}: *suppressed sensitive resource output*" + else + raise "Failed to join the domain #{new_resource.domain_name}: #{ps_run.stderr}" + end + end unless new_resource.reboot == :never reboot "Reboot to join domain #{new_resource.domain_name}" do @@ -104,6 +110,10 @@ class Chef reboot_action end end + + def sensitive? + !!new_resource.sensitive + end end end end |