diff --git a/CHANGELOG b/CHANGELOG index 139a638..f8141d7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,40 +1,66 @@ +2013-08-09 1.0.0 + +Summary: + +Many new features and bugfixes in this release, and if you're a heavy concat +user you should test carefully before upgrading. The features should all be +backwards compatible but only light testing has been done from our side before +this release. + +Features: +- New parameters in concat: + - `replace`: specify if concat should replace existing files. + - `ensure_newline`: controls if fragments should contain a newline at the end. +- Improved README documentation. +- Add rspec:system tests (rake spec:system to test concat) + +Bugfixes +- Gracefully handle \n in a fragment resource name. +- Adding more helpful message for 'pluginsync = true' +- Allow passing `source` and `content` directly to file resource, rather than +defining resource defaults. +- Added -r flag to read so that filenames with \ will be read correctly. +- sort always uses LANG=C. +- Allow WARNMSG to contain/start with '#'. +- Replace while-read pattern with for-do in order to support Solaris. + CHANGELOG: - 2010/02/19 - initial release - 2010/03/12 - add support for 0.24.8 and newer - make the location of sort configurable - add the ability to add shell comment based warnings to top of files - add the ablity to create empty files - 2010/04/05 - fix parsing of WARN and change code style to match rest of the code - Better and safer boolean handling for warn and force - Don't use hard coded paths in the shell script, set PATH top of the script - Use file{} to copy the result and make all fragments owned by root. This means we can chnage the ownership/group of the resulting file at any time. - You can specify ensure => "/some/other/file" in concat::fragment to include the contents of a symlink into the final file. - 2010/04/16 - Add more cleaning of the fragment name - removing / from the $name - 2010/05/22 - Improve documentation and show the use of ensure => - 2010/07/14 - Add support for setting the filebucket behavior of files - 2010/10/04 - Make the warning message configurable - 2010/12/03 - Add flags to make concat work better on Solaris - thanks Jonathan Boyett - 2011/02/03 - Make the shell script more portable and add a config option for root group - 2011/06/21 - Make base dir root readable only for security - 2011/06/23 - Set base directory using a fact instead of hardcoding it - 2011/06/23 - Support operating as non privileged user - 2011/06/23 - Support dash instead of bash or sh - 2011/07/11 - Better solaris support - 2011/12/05 - Use fully qualified variables - 2011/12/13 - Improve Nexenta support - 2012/04/11 - Do not use any GNU specific extensions in the shell script - 2012/03/24 - Comply to community style guides - 2012/05/23 - Better errors when basedir isnt set - 2012/05/31 - Add spec tests - 2012/07/11 - Include concat::setup in concat improving UX - 2012/08/14 - Puppet Lint improvements - 2012/08/30 - The target path can be different from the $name - 2012/08/30 - More Puppet Lint cleanup - 2012/09/04 - RELEASE 0.2.0 - 2012/12/12 - Added (file) $replace parameter to concat diff --git a/Modulefile b/Modulefile index 3815edd..cb6bc2e 100644 --- a/Modulefile +++ b/Modulefile @@ -1,8 +1,8 @@ -name 'ripienaar-concat' -version '0.2.0' -source 'git://github.com/ripienaar/puppet-concat.git' -author 'R.I.Pienaar' -license 'Apache' +name 'puppetlabs-concat' +version '1.0.0-rc1' +source 'git://github.com/puppetlabs/puppetlabs-concat.git' +author 'Puppetlabs' +license 'Apache 2.0' summary 'Concat module' description 'Concat module' -project_page 'http://github.com/ripienaar/puppet-concat' +project_page 'http://github.com/puppetlabs/puppetlabs-concat' diff --git a/README b/README index 81bdedb..650141c 100644 --- a/README +++ b/README @@ -1,94 +1,91 @@ == Module: concat A system to construct files using fragments from other files or templates. This requires at least puppet 0.25 to work correctly as we use some enhancements in recursive directory management and regular expressions to do the work here. === Usage: The basic use case is as below: concat{"/etc/named.conf": notify => Service["named"] } concat::fragment{"foo.com_config": target => "/etc/named.conf", order => 10, content => template("named_conf_zone.erb") } # add a fragment not managed by puppet so local users # can add content to managed file concat::fragment{"foo.com_user_config": target => "/etc/named.conf", order => 12, ensure => "/etc/named.conf.local" } This will use the template named_conf_zone.erb to build a single bit of config up and put it into the fragments dir. The file will have an number prefix of 10, you can use the order option to control that and thus control the order the final file gets built in. You can also specify a path and use a different name for your resources: # You can make this something dynamic, based on whatever parameters your # module/class for example. $vhost_file = '/etc/httpd/vhosts/01-my-vhost.conf' concat{'apache-vhost-myvhost': path => $vhost_file, } # We don't care where the file is located, just what to put in it. concat::fragment {'apache-vhost-myvhost-main': target => 'apache-vhost-myvhost', content => '', order => 01, } concat::fragment {'apache-vhost-myvhost-close': target => 'apache-vhost-myvhost', content => '', order => 99, } === Setup: The class concat::setup uses the fact concat_basedir to define the variable $concatdir, where all the temporary files and fragments will be durably stored. The fact concat_basedir will be set up on the client to /concat, so you will be able to run different setup/flavours of puppet clients. However, since this requires the file lib/facter/concat_basedir.rb to be deployed on the clients, so you will have to set "pluginsync = true" on both the master and client, at least for the first run. There's some regular expression magic to figure out the puppet version but if you're on an older 0.24 version just set $puppetversion = 24 === Detail: We use a helper shell script called concatfragments.sh that gets placed in /concat/bin to do the concatenation. While this might seem more complex than some of the one-liner alternatives you might find on the net we do a lot of error checking and safety checks in the script to avoid problems that might be caused by complex escaping errors etc. === License: Apache Version 2 === Latest: -http://github.com/ripienaar/puppet-concat/ +http://github.com/puppetlabs/puppetlabs-concat/ === Contact: -* R.I.Pienaar -* Volcane on freenode -* @ripienaar on twitter -* www.devco.net +Puppetlabs, via our puppet-users@ mailing list. diff --git a/README.markdown b/README.markdown index 567fb9c..c9a52b3 100644 --- a/README.markdown +++ b/README.markdown @@ -1,154 +1,154 @@ What is it? =========== A Puppet module that can construct files from fragments. Please see the comments in the various .pp files for details as well as posts on my blog at http://www.devco.net/ Released under the Apache 2.0 licence Usage: ------ If you wanted a /etc/motd file that listed all the major modules on the machine. And that would be maintained automatically even if you just remove the include lines for other modules you could use code like below, a sample /etc/motd would be:
 Puppet modules on this server:
 
     -- Apache
     -- MySQL
 
Local sysadmins can also append to the file by just editing /etc/motd.local their changes will be incorporated into the puppet managed motd.
 # class to setup basic motd, include on all nodes
 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,
    }
 
    # local users on the machine can append to motd by just creating
    # /etc/motd.local
    concat::fragment{"motd_local":
       target => $motd,
       ensure  => "/etc/motd.local",
       order   => 15
    }
 }
 
 # used by other modules to 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",
       content => "    -- $body\n"
    }
 }
 
 # a sample apache module
 class apache {
    include apache::install, apache::config, apache::service
 
    motd::register{"Apache": }
 }
 
Detailed documentation of the class options can be found in the manifest files. Known Issues: ------------- * Since puppet-concat now relies on a fact for the concat directory, you will need to set up pluginsync = true on the [master] section of your node's '/etc/puppet/puppet.conf' for at least the first run. You have this issue if puppet fails to run on the client and you have a message similar to "err: Failed to apply catalog: Parameter path failed: File paths must be fully qualified, not 'undef' at [...]/concat/manifests/setup.pp:44". Contributors: ------------- **Paul Elliot** * Provided 0.24.8 support, shell warnings and empty file creation support. **Chad Netzer** * Various patches to improve safety of file operations * Symlink support **David Schmitt** * Patch to remove hard coded paths relying on OS path * Patch to use file{} to copy the resulting file to the final destination. This means Puppet client will show diffs and that hopefully we can change file ownerships now **Peter Meier** * Basedir as a fact * Unprivileged user support **Sharif Nassar** * Solaris/Nexenta support * Better error reporting **Christian G. Warden** * Style improvements **Reid Vandewiele** * Support non GNU systems by default **Erik Dalén** * Style improvements **Gildas Le Nadan** * Documentation improvements **Paul Belanger** * Testing improvements and Travis support **Branan Purvine-Riley** * Support Puppet Module Tool better **Dustin J. Mitchell** * Always include setup when using the concat define **Andreas Jaggi** * Puppet Lint support **Jan Vansteenkiste** * Configurable paths Contact: -------- -R.I.Pienaar / rip@devco.net / @ripienaar / http://devco.net +puppet-users@ mailing list.