summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanga17 <sausekar@msystechnologies.com>2020-04-08 10:45:16 +0530
committerTim Smith <tsmith84@gmail.com>2020-04-08 09:41:18 -0700
commit69fb5aebd65cbf861c5bf39d89429bc3285e6084 (patch)
treec7c7e9ee3121e625fcc84c82f3deeb63c9f39ce8
parent73b23a8af478fd434b9f2ecac1b4552924c5008d (diff)
downloadchef-69fb5aebd65cbf861c5bf39d89429bc3285e6084.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 b7bd2b4e2d..8fc738d2db 100644
--- a/lib/chef/provider/systemd_unit.rb
+++ b/lib/chef/provider/systemd_unit.rb
@@ -237,6 +237,7 @@ class Chef
f.owner "root"
f.group "root"
f.mode "0644"
+ f.sensitive new_resource.sensitive
f.content new_resource.to_ini
f.verify :systemd_unit if new_resource.verify
end.run_action(action)
diff --git a/lib/chef/resource/systemd_unit.rb b/lib/chef/resource/systemd_unit.rb
index a4f087b220..1c807ea84a 100644
--- a/lib/chef/resource/systemd_unit.rb
+++ b/lib/chef/resource/systemd_unit.rb
@@ -65,6 +65,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