concat
: Manages a file, compiled from one or more text fragments.concat::fragment
: Manages a fragment of text to be compiled into a file.
concat_file
: Generates a file with content from fragments sharing a common unique tag.concat_fragment
: Manages the fragment.
Manages a file, compiled from one or more text fragments.
concat { '/tmp/concat':
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
}
The following parameters are available in the concat
defined type:
backup
ensure
ensure_newline
format
force
group
mode
order
owner
path
replace
selinux_ignore_defaults
selrange
selrole
seltype
seluser
show_diff
validate_cmd
warn
create_empty_file
Data type: Variant[Boolean, String]
Specifies whether (and how) to back up the destination file before overwriting it. Your value gets passed on to Puppet's native file resource for execution. Valid options: true, false, or a string representing either a target filebucket or a filename extension beginning with ".".
Default value: 'puppet'
Data type: Enum['present', 'absent']
Specifies whether the destination file should exist. Setting to 'absent' tells Puppet to delete the destination file if it exists, and negates the effect of any other parameters.
Default value: 'present'
Data type: Boolean
Specifies whether to add a line break at the end of each fragment that doesn't already end in one.
Default value: false
Data type: Enum['plain', 'yaml', 'json', 'json-array', 'json-pretty', 'json-array-pretty']
Specify what data type to merge the fragments as. Valid options: 'plain', 'yaml', 'json', 'json-array', 'json-pretty', 'json-array-pretty'.
Default value: 'plain'
Data type: Boolean
Specifies whether to merge data structures, keeping the values with higher order. Used when format is specified as a value other than 'plain'.
Default value: false
Data type: Optional[Variant[String, Integer]]
Specifies a permissions group for the destination file. Valid options: a string containing a group name or integer containing a gid.
Default value: undef
Data type: String
Specifies the permissions mode of the destination file. Valid options: a string containing a permission mode value in octal notation.
Default value: '0644'
Data type: Enum['alpha','numeric']
Specifies a method for sorting your fragments by name within the destination file. You can override this setting for individual fragments by adjusting the order parameter in their concat::fragment declarations.
Default value: 'alpha'
Data type: Optional[Variant[String, Integer]]
Specifies the owner of the destination file. Valid options: a string containing a username or integer containing a uid.
Default value: undef
Data type: Stdlib::Absolutepath
Specifies a destination file for the combined fragments.
Default value: $name
Data type: Boolean
Specifies whether to overwrite the destination file if it already exists.
Default value: true
Data type: Optional[Boolean]
See the file type's selinux_ignore_defaults documentention: https://docs.puppetlabs.com/references/latest/type.html#file-attribute-selinux_ignore_defaults
Default value: undef
Data type: Optional[String]
See the file type's selrange documentention: https://docs.puppetlabs.com/references/latest/type.html#file-attribute-selrange
Default value: undef
Data type: Optional[String]
See the file type's selrole documentention: https://docs.puppetlabs.com/references/latest/type.html#file-attribute-selrole
Default value: undef
Data type: Optional[String]
See the file type's seltype documentention: https://docs.puppetlabs.com/references/latest/type.html#file-attribute-seltype
Default value: undef
Data type: Optional[String]
See the file type's seluser documentention: https://docs.puppetlabs.com/references/latest/type.html#file-attribute-seluser
Default value: undef
Data type: Boolean
Specifies whether to set the show_diff parameter for the file resource. Useful for hiding secrets stored in hiera from insecure reporting methods.
Default value: true
Data type: Optional[String]
Specifies a validation command to apply to the destination file.
Default value: undef
Data type: Variant[Boolean, String]
Specifies whether to add a header message at the top of the destination file. Valid options: the booleans true and false, or a string
to serve as the header.
If you set 'warn' to true, concat adds the following line with an order of 0:
# This file is managed by Puppet. DO NOT EDIT.
Before 2.0.0, this parameter would add a newline at the end of the warn message. To improve flexibilty, this was removed. Please add
it explicitly if you need it.
Default value: false
Data type: Boolean
Specifies whether to create an empty file if no fragments are defined. Defaults to true.
Default value: true
Manages a fragment of text to be compiled into a file.
The following parameters are available in the concat::fragment
defined type:
Data type: Optional[Variant[Sensitive[String], String, Deferred]]
Supplies the content of the fragment. Note: You must supply either a content parameter or a source parameter. Allows a String or a Deferred function which returns a String.
Default value: undef
Data type: Variant[String, Integer]
Reorders your fragments within the destination file. Fragments that share the same order number are ordered by name. The string option is recommended.
Default value: '10'
Data type: Optional[Variant[String, Array]]
Specifies a file to read into the content of the fragment. Note: You must supply either a content parameter or a source parameter. Valid options: a string or an array, containing one or more Puppet URLs.
Default value: undef
Data type: String
Specifies the destination file of the fragment. Valid options: a string containing the path or title of the parent concat resource.
Generates a file with content from fragments sharing a common unique tag.
Concat_fragment <<| tag == 'unique_tag' |>>
concat_file { '/tmp/file':
tag => 'unique_tag', # Optional. Default to undef
path => '/tmp/file', # Optional. If given it overrides the resource name
owner => 'root', # Optional. Default to undef
group => 'root', # Optional. Default to undef
mode => '0644' # Optional. Default to undef
order => 'numeric' # Optional, Default to 'numeric'
ensure_newline => false # Optional, Defaults to false
}
The following properties are available in the concat_file
type.
Valid values: present
, absent
Specifies whether the destination file should exist. Setting to 'absent' tells Puppet to delete the destination file if it exists, and negates the effect of any other parameters.
Default value: present
The following parameters are available in the concat_file
type.
backup
create_empty_file
ensure_newline
force
format
group
mode
order
owner
path
replace
selinux_ignore_defaults
selrange
selrole
seltype
seluser
show_diff
tag
validate_cmd
Specifies whether (and how) to back up the destination file before overwriting it. Your value gets passed on to Puppet's native file resource for execution. Valid options: true, false, or a string representing either a target filebucket or a filename extension beginning with ".".'
Valid values: true
, false
, yes
, no
Specifies whether to create an empty file if no fragments are defined.
Default value: true
Valid values: true
, false
, yes
, no
Specifies whether to add a line break at the end of each fragment that doesn't already end in one.
Default value: false
Valid values: true
, false
, yes
, no
Specifies whether to merge data structures, keeping the values with higher order.
Default value: false
Valid values: plain
, yaml
, json
, json-array
, json-pretty
, json-array-pretty
Specify what data type to merge the fragments as. Valid options: 'plain', 'yaml', 'json', 'json-array', 'json-pretty', 'json-array-pretty'.
Default value: plain
Specifies a permissions group for the destination file. Valid options: a string containing a group name or integer containing a gid.
Specifies the permissions mode of the destination file. Valid options: a string containing a permission mode value in octal notation.
Valid values: alpha
, numeric
Specifies a method for sorting your fragments by name within the destination file. You can override this setting for individual fragments by adjusting the order parameter in their concat::fragment declarations.
Default value: numeric
Specifies the owner of the destination file. Valid options: a string containing a username or integer containing a uid.
Specifies a destination file for the combined fragments. Valid options: a string containing an absolute path. Default value: the title of your declared resource.
Valid values: true
, false
, yes
, no
Specifies whether to overwrite the destination file if it already exists.
Default value: true
Valid values: true
, false
, yes
, no
See the file type's selinux_ignore_defaults documentention: https://docs.puppetlabs.com/references/latest/type.html#file-attribute-selinux_ignore_defaults.
See the file type's selrange documentation: https://docs.puppetlabs.com/references/latest/type.html#file-attribute-selrange
See the file type's selrole documentation: https://docs.puppetlabs.com/references/latest/type.html#file-attribute-selrole
See the file type's seltype documentation: https://docs.puppetlabs.com/references/latest/type.html#file-attribute-seltype
See the file type's seluser documentation: https://docs.puppetlabs.com/references/latest/type.html#file-attribute-seluser
Valid values: true
, false
, yes
, no
Specifies whether to set the show_diff parameter for the file resource. Useful for hiding secrets stored in hiera from insecure reporting methods.
Required. Specifies a unique tag reference to collect all concat_fragments with the same tag.
Specifies a validation command to apply to the destination file. Requires Puppet version 3.5 or newer. Valid options: a string to be passed to a file resource.
Manages the fragment.
# The example is based on exported resources.
concat_fragment { "uniqe_name_${::fqdn}":
tag => 'unique_name',
order => 10, # Optional. Default to 10
content => 'some content' # OR
# content => template('template.erb')
source => 'puppet:///path/to/file'
}
The following parameters are available in the concat_fragment
type.
Supplies the content of the fragment. Note: You must supply either a content parameter or a source parameter. Valid options: a string
namevar
Name of resource.
Reorders your fragments within the destination file. Fragments that share the same order number are ordered by name. The string option is recommended.
Default value: 10
Specifies a file to read into the content of the fragment. Note: You must supply either a content parameter or a source parameter. Valid options: a string or an array, containing one or more Puppet URLs.
Specifies a unique tag to be used by concat_file to reference and collect content.
Required. Specifies the destination file of the fragment. Valid options: a string containing the path or title of the parent concat_file resource.