Giter VIP home page Giter VIP logo

puppetlabs-concat's Introduction

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

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

License

This codebase is licensed under the Apache2.0 licensing, however due to the nature of the codebase the open source dependencies may also use a combination of AGPL, BSD-2, BSD-3, GPL2.0, LGPL, MIT and MPL Licensing.

Development

Acceptance tests for this module leverage puppet_litmus. To run the acceptance tests follow the instructions here. You can also find a tutorial and walkthrough of using Litmus and the PDK on YouTube.

If you run into an issue with this module, or if you would like to request a feature, please file a ticket. Every Tuesday the Content and Tooling Team has office hours in the Puppet Community Slack, where you can ask questions about this and any other supported modules. This session usually runs at, approximately, 15:00 (BST), for about an hour.

If you have problems getting this module up and running, please contact Support.

If you submit a change to this module, be sure to regenerate the reference documentation as follows:

puppet strings generate --format markdown --out REFERENCE.md

Contributors

Richard Pijnenburg (@Richardp82)

Joshua Hoblitt (@jhoblitt)

More contributors.

puppetlabs-concat's People

Contributors

hunner avatar bmjen avatar david22swan avatar lukasaud avatar pmcmaw avatar ripienaar avatar eimlav avatar davids avatar tphoney avatar lionce avatar eputnam avatar jordanbreen28 avatar sheenaajay avatar cyberious avatar cmurphy avatar ramesh7 avatar daianamezdrea avatar hail9000 avatar chelnak avatar gspatton avatar sanfrancrisko avatar malikparvez avatar michaeltlombardi avatar duritong avatar glennsarti avatar florindragos avatar adrianiurca avatar j-vizcaino avatar bastelfreak avatar jhoblitt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.