Forge Home

concatfile

UNKNOWN

11,036 downloads

10,390 latest version

1.9 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.0.4 (latest)
  • 0.0.2 (deleted)
  • 0.0.1 (deleted)
released Nov 30th 2012

Start using this module

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

Add this module to your Puppetfile:

mod 'anselm-concatfile', '0.0.4'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add anselm-concatfile
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install anselm-concatfile --version 0.0.4

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

anselm/concatfile — version 0.0.4 Nov 30th 2012

puppet-concatfile

Description

A very simple Puppet module that concatenates multiple text parts together to one file. The single parts can be file sources, string content or existing files on the target system.

Dependencies

Usage

First, define the file that should be concatenated from the parts:

The dir parameter specifies in which folder the parts are collected.

Then, define some parts:

The directory in the resource name of each part must match the dir parameter used in the concatfile resource, that is how Puppet knows they are connected. The files will later be sorted numerically and concatenated in that order.

The result is that the file /etc/sysctl.conf is concatenated from the 3 files in /etc/sysctl.conf.d/. Their content comes from 3 different possible sources: a Puppet files resource, a string and a symlink to a local file.

Details

Behavior

Each part is deployed as file in the specified folder. A simple exec command in the form of find ... | sort ... | cat ... > target_file is then used to concatenate all parts together. Apart from the basic update behavior from Puppet when any file is removed/modified, or any definition in the code is added/modified/removed, an update should also be triggered when a alien file is placed in the folder where the parts are stored, and the file gets removed.

Parameters

Possible parameters to concatfile are:

  • dir (required)
  • owner
  • group
  • mode

Possible parameters to concatfile::part are:

  • source
  • content
  • file
  • owner
  • group
  • mode

Only one of source, content or file makes sense and is allowed.

Extending

The defines can easily be wrapped to save some typing or e.g. introduce an order parameter:

Todo

  • Triggering the update when the concatenated file is modified was not tested (did not have a puppet master around, and remembering checksums does not work completely with Puppet in standalone mode).

Written By

Anselm Strauss http://github.com/amsibamsi