From a9a287915bc282dd158baa9f220bd569d6faa63f Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Wed, 3 Jun 2020 11:09:30 +0200 Subject: [PATCH] Hide erlang cookie content Override the is_to_s and should_to_s methods in the puppet property to make sure it's not shown in outputs. Closes: #837 --- lib/puppet/type/rabbitmq_erlang_cookie.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/puppet/type/rabbitmq_erlang_cookie.rb b/lib/puppet/type/rabbitmq_erlang_cookie.rb index 0673cafd6..690c91be8 100644 --- a/lib/puppet/type/rabbitmq_erlang_cookie.rb +++ b/lib/puppet/type/rabbitmq_erlang_cookie.rb @@ -16,9 +16,20 @@ newproperty(:content) do desc 'Content of cookie' newvalues(%r{^\S+$}) + def change_to_s(_current, _desired) 'The rabbitmq erlang cookie was changed' end + + # rubocop:disable Style/PredicateName + def is_to_s(_value) + '[old content redacted]' + end + # rubocop:enable Style/PredicateName + + def should_to_s(_value) + '[new content redacted]' + end end newparam(:force) do