Forge Home

concat

Construct files from multiple fragments.

87,168,859 downloads

10,346 latest version

5.0 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

  • 9.0.2 (latest)
  • 9.0.1
  • 9.0.0
  • 8.0.1
  • 8.0.0
  • 7.4.0
  • 7.3.3
  • 7.3.2
  • 7.3.1
  • 7.3.0
  • 7.2.0
  • 7.1.1
  • 7.1.0
  • 7.0.2
  • 7.0.1
  • 7.0.0
  • 6.4.0
  • 6.3.0
  • 6.2.0
  • 6.1.0
  • 6.0.0
  • 5.3.0
  • 5.2.0
  • 5.1.0
  • 5.0.0
  • 4.2.1
  • 4.2.0
  • 4.1.1
  • 4.1.0
  • 4.0.1
  • 4.0.0
  • 3.0.0
  • 2.2.1
  • 2.2.0
  • 2.1.0
  • 2.0.1 (deleted)
  • 2.0.0 (deleted)
  • 1.2.5
  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.1.0-rc1 (pre-release)
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
  • 1.0.0-rc1 (pre-release)
released May 21st 2019
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
  • Puppet >= 5.5.10 < 7.0.0
  • , , , , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppetlabs-concat', '6.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppetlabs-concat
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-concat --version 6.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppetlabs/concat — version 6.0.0 May 21st 2019

concat

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

Overview

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'
}

Usage

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>

Reference

See REFERENCE.md

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.

Limitations

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

Development

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.

Contributors

Richard Pijnenburg (@Richardp82)

Joshua Hoblitt (@jhoblitt)

More contributors.