summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanga17 <sausekar@msystechnologies.com>2020-04-08 10:45:16 +0530
committersanga17 <sausekar@msystechnologies.com>2020-04-08 10:45:16 +0530
commitc50d3379fe2a671638a880f621e1f8ec5db8af58 (patch)
treeb1d1ab7b68cf4a8a4e243ed800a7828f8efecf66
parentcb4383bb80656be29db6194308d6a913894ad218 (diff)
downloadchef-c50d3379fe2a671638a880f621e1f8ec5db8af58.tar.gz
Fixed systemd_unit not respecting sensitive property
Signed-off-by: sanga17 <sausekar@msystechnologies.com>
-rw-r--r--lib/chef/provider/systemd_unit.rb1
-rw-r--r--lib/chef/resource/systemd_unit.rb3
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/chef/provider/systemd_unit.rb b/lib/chef/provider/systemd_unit.rb
index f1b104de21..39876f7a3f 100644
--- a/lib/chef/provider/systemd_unit.rb
+++ b/lib/chef/provider/systemd_unit.rb
@@ -237,6 +237,7 @@ class Chef
owner "root"
group "root"
mode "0644"
+ sensitive new_resource.sensitive
content new_resource.to_ini
verify :systemd_unit if new_resource.verify
action the_action
diff --git a/lib/chef/resource/systemd_unit.rb b/lib/chef/resource/systemd_unit.rb
index 9e7067bd70..614479e4f3 100644
--- a/lib/chef/resource/systemd_unit.rb
+++ b/lib/chef/resource/systemd_unit.rb
@@ -67,6 +67,9 @@ class Chef
description: "The name of the unit file if it differs from the resource block's name.",
introduced: "13.7"
+ property :sensitive, [ TrueClass, FalseClass ],
+ default: false, desired_state: false
+
def to_ini
case content
when Hash