Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/puppet/type/concat_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,12 @@ def should_content
return @generated_content if @generated_content

@generated_content = ''
@has_sensitive_content_fragments = false
content_fragments = []

fragments.each do |r|
content_fragments << ["#{r[:order]}___#{r[:name]}", fragment_content(r)]
@has_sensitive_content_fragments ||= r.parameters[:content]&.sensitive
end

sorted = if self[:order] == :numeric
Expand Down Expand Up @@ -354,6 +356,7 @@ def eval_generate
content = should_content

catalog.resource("File[#{self[:path]}]")[:content] = content unless content.nil?
catalog.resource("File[#{self[:path]}]").parameters[:content].sensitive = @has_sensitive_content_fragments

catalog.resource("File[#{self[:path]}]")[:ensure] = :absent if !self[:create_empty_file] && (content.nil? || content.empty?)

Expand Down
Loading