Forge Home

concat_native

Deprecated native type for multi-part file concatenation

221,505 downloads

114,899 latest version

3.1 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.5.0 (latest)
  • 1.4.0
  • 1.3.2
  • 1.3.1
  • 1.3.0
  • 1.2.0
  • 1.2.0-rc3 (pre-release)
  • 1.2.0-rc2 (pre-release)
  • 1.2.0-rc1 (pre-release)
released May 21st 2015
This version is compatible with:
  • Puppet >= 2.7.0 < 4.0.0
  • , , , , ,
This module has been deprecated by its author since Oct 27th 2017.

The author has suggested puppetlabs-concat as its replacement.

Start using this module

Documentation

theforeman/concat_native — version 1.5.0 May 21st 2015

Puppet Concat Module

This is a module that provides a native type for performing multi-part file concatenation, generally referred to by the Puppet Labs team as the File Fragment Pattern.

The concept is based on ideas that R.I. Pienaar describes on his Building files from fragments in Puppet page.

Deprecation warning

This module is deprecated in favour of puppetlabs-concat 2.0.0 or higher.

It used to be a better alternative than the 1.x series by being implemented as a native type instead of shell scripts, but 2.x rewrote concat as native types. theforeman modules will be updated to use puppetlabs-concat and this module will not be maintained.

Installation

The recommended way to install this package is either through the Puppet module manager or via RPM. A spec file has been included that can be used to create an RPM if required.

This module is known to be compatible with Puppet 2.6.

Basic Usage

This module has been designed to be quite flexible but follows the basic pattern of specifying file fragments and subsequently building a target file.

See the comments in the code for the definition of all options.

concat_build { "identifier":
  order => ['*.tmp'],
  target => '/tmp/test'
}

concat_fragment { "identifier+01.tmp":
  content => "Some random stuff"
}

concat_fragment { "identifier+02.tmp":
  content => "Some other random stuff"
}

Appending without newlines

If, for example, you wanted your fragments to join together to be a comma-separated list, you can achieve this by doing:

concat_build { "identifier":
  order => ['*.tmp'],
  target => '/tmp/test',
  file_delimiter => ",",
  append_newline => false
}

Chained Builds

There are times where you're going to want to chain multiple concat fragment builds into a single entity. Multi-part or INI-style files is generally where this comes into play.

An example of this type of build is as follows:

concat_build { "identifier":
  order => ['*.tmp'],
  target => '/tmp/test'
}

concat_fragment { "identifier+01.tmp":
  content => "Some random stuff"
}

concat_fragment { "identifier+02.tmp":
  content => "Some other random stuff"
}

concat_build { "subtest":
  parent_build => "identifier",
  target => "/var/lib/puppet/concat_native/fragments/identifier/subtest.tmp"
}

concat_fragment { "subtest+sub1":
  content => "Sub-build stuff"
}

concat_fragment { "subtest+sub2":
  content => "More sub-build stuff"
}

Notes

Concat fragments are stored under Puppet[:vardir]/concat_native/fragments.

Copyright

Copyright (C) 2012 Onyx Point, Inc. http://onyxpoint.com/

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.