File concatenation system for Puppet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
TP Honey 61416697cd
Merge pull request #599 from puppetlabs/FM-8398
4 days ago
.vscode (FM-7709) pdksync and remove beaker 2 months ago
examples (FM-7340) - Add additional example 9 months ago
lib/puppet/type (MODULES-9479) Fix nested array merge behavior (#593) 1 month ago
locales (L10n) Updating translations for locales/ja/puppetlabs-concat.po 8 months ago
manifests Updated regex to allow for windows paths with \'s 2 months ago
readmes (L10n) Updating translations for readmes/ 8 months ago
spec (MAINT) pdksync: fix for net-ssh 5 host_key check 1 week ago
.fixtures.yml (FM-7606) enable litmus for concat 4 months ago
.gitattributes (FM-7339) - Add i18n implementation 9 months ago
.gitignore pdksync - (maint) Update pdk-template to f778803 5 months ago
.pdkignore pdksync - (maint) Update pdk-template to f778803 5 months ago
.project (MODULES-4098) Sync the rest of the files 2 years ago
.puppet-lint.rc pdksync - (maint) Update pdk-template to f778803 5 months ago
.rspec (FM-4049) Update to current msync configs [2c99161] 3 years ago
.rubocop.yml (FM-7709) pdksync and remove beaker 2 months ago
.rubocop_todo.yml Fix rubocop offenses 7 months ago
.sync.yml (FM-7709) pdksync and remove beaker 2 months ago
.travis.yml Update .travis.yml 1 week ago
.yardopts pdksync_heads/master-0-g85ca41b 1 year ago Release prep v6.1.0 1 month ago (maint) modulesync 892c4cf 2 years ago
Gemfile MODULES-9692 - pdksync_1.12.0-0-g55d9ae2 1 month ago (MODULES-7706) - Release Prep for 5.0.0 1 year ago
LICENSE (FM-4046) Update to current msync configs [006831f] 3 years ago (MODULES-4098) Sync the rest of the files 2 years ago
NOTICE (maint) modulesync 65530a4 Update Travis 1 year ago MODULES-9057 fix docs link 3 months ago (FM-7341) - Added and updated documentation 9 months ago
Rakefile (FM-7709) pdksync and remove beaker 2 months ago
appveyor.yml (FM-7606) enable litmus for concat 4 months ago
distelli-manifest.yml (FM-7606) enable litmus for concat 4 months ago
metadata.json support Debian10 5 days ago
provision.yaml support Debian10 5 days ago


Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module


The concat module lets you construct files from multiple ordered fragments of text.

Module Description

The concat module lets you gather concat::fragment resources from your other modules and order them into a coherent file through a single concat resource.

Beginning with concat

To start using concat you need to create:

  • A concat{} resource for the final file.
  • One or more concat::fragment{}s.

A minimal example might be:

concat { '/tmp/file':
  ensure => present,

concat::fragment { 'tmpfile':
  target  => '/tmp/file',
  content => 'test contents',
  order   => '01'


Maintain a list of the major modules on a node

To maintain an motd file that lists the modules on one of your nodes, first create a class to frame up the file:

class motd {
  $motd = '/etc/motd'

  concat { $motd:
    owner => 'root',
    group => 'root',
    mode  => '0644'

  concat::fragment { 'motd_header':
    target  => $motd,
    content => "\nPuppet modules on this server:\n\n",
    order   => '01'

  # let local users add to the motd by creating a file called
  # /etc/motd.local
  concat::fragment { 'motd_local':
    target => $motd,
    source => '/etc/motd.local',
    order  => '15'

# let other modules register themselves in the motd
define motd::register (
  $content = "",
  $order   = '10',
) {
  if $content == "" {
    $body = $name
  } else {
    $body = $content

  concat::fragment { "motd_fragment_$name":
    target  => '/etc/motd',
    order   => $order,
    content => "    -- $body\n"

Then, in the declarations for each module on the node, add motd::register{ 'Apache': } to register the module in the motd.

class apache {
  include apache::install, apache::config, apache::service

  motd::register { 'Apache': }

These two steps populate the /etc/motd file with a list of the installed and registered modules, which stays updated even if you just remove the registered modules’ include lines. System administrators can append text to the list by writing to /etc/motd.local.

When you’re finished, the motd file will look something like this:

  Puppet modules on this server:

    -- Apache
    -- MySQL

  <contents of /etc/motd.local>



Removed functionality

The following functionality existed in previous versions of the concat module, but was removed in version 2.0.0:

Parameters removed from concat::fragment:

  • gnu
  • backup
  • group
  • mode
  • owner

The concat::setup class has also been removed.

Prior to concat version 2.0.0, if you set the warn parameter to a string value of true, false, ‘yes’, ‘no’, ‘on’, or ‘off’, the module translated the string to the corresponding boolean value. In concat version 2.0.0 and newer, the warn_header parameter treats those values the same as other strings and uses them as the content of your header message. To avoid that, pass the true and false values as booleans instead of strings.


This module has been tested on all PE-supported platforms, and no issues have been identified.

For an extensive list of supported operating systems, see metadata.json


We are experimenting with a new tool for running acceptance tests. It’s name is puppet_litmus this replaces beaker as the test runner. To run the acceptance tests follow the instructions here.

Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.

We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

For more information, see our module contribution guide.


Richard Pijnenburg (@Richardp82)

Joshua Hoblitt (@jhoblitt)

More contributors.