Skip to content

Commit

Permalink
Hide erlang cookie content
Browse files Browse the repository at this point in the history
Override the is_to_s and should_to_s
methods in the puppet property to make
sure it's not shown in outputs.

Closes: voxpupuli#837
  • Loading branch information
tobias-urdin committed Jun 3, 2020
1 parent 77b0033 commit a9a2879
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/puppet/type/rabbitmq_erlang_cookie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9a2879

Please sign in to comment.