Commit graph

58 commits

Author SHA1 Message Date
Ashley Penney
7437a68016 Merge pull request #91 from jhoblitt/exec_as_root_when_root
always exec the concatfragments script as root when running as root
2013-11-02 13:14:51 -07:00
Ashley Penney
9c6378a78c Merge pull request #93 from jhoblitt/tidyups
Tidyups
2013-11-02 13:14:00 -07:00
Joshua Hoblitt
79352f4da6 allow concat::fragment target param to be an arbitrary string
Revert validation of the target param as an absolute path and allow it to be an
arbitrary string.  This is so the

    concat { <foo>: path => ...  }
    concat::fragment { ...: target => <foo> }

association may be symbolic as long as concat path param is specified.  This
should resolve the symbolic name regression introduced in:
https://github.com/puppetlabs/puppetlabs-concat/commit/eaf84079
2013-11-02 09:33:41 -07:00
Joshua Hoblitt
b6e9b1c693 fix or suppress all lint warnings 2013-11-01 18:52:59 -07:00
Joshua Hoblitt
256e0bdf9f remove usage of resource defaults for file owner/permissions
In addition, the permissions of the fragment directory and files is now fixed and not world readable.
2013-11-01 18:23:24 -07:00
Joshua Hoblitt
200e4ee205 always exec the concatfragments script as root when running as root
This is to allow the concatfragments script to be installed into a path that may not be accessible by a non-root user.
2013-11-01 18:23:24 -07:00
Joshua Hoblitt
7c4f929e42 add deprecation warnings on removed parameters + warn on inclusion of concat::setup 2013-10-30 22:06:02 -07:00
Luis Fernandez Alvarez
b09be245d4 Add Windows support
- It adds a ruby version of the bash script.
- Refactor setup.pp to include new variables.
- Generalizes command execution according to variables in setup.pp.
2013-10-25 14:47:03 +02:00
Joshua Hoblitt
2ec19b80f9 remove purging of /usr/local/bin/concatfragments.sh
The hard coded path of `/usr/local/bin/concatfragments.sh` hasn't been
used for "a long time" so there's no reason to carry the cleanup around
any longer.
2013-10-24 09:34:31 -07:00
Joshua Hoblitt
aa0180d69a remove default owner/user and group values
The use of $::id to set the default user/owner and group has caused
multiple bugs in the past, is incorrectly used to infer the egid,
introduces a dependency on the `id` fact, and provides no functionally
that can't be accomplished by passing `undef` or not setting the
respective params on the file & exec types.

A possible alternative would be to introduce a dep on the $::gid fact
but that would mean the entire module would depend on a version of
facter than hasn't shipped yet (unworkable) or to add a gid/egid fact
into this module (ugly).
2013-10-24 08:48:37 -07:00
Joshua Hoblitt
4d884d3242 only backup target concat file + remove backup param from concat::fragment
Disable filebucket backup of all file resources except for the the
target file that's being concatenated.
2013-10-23 15:42:44 -07:00
Joshua Hoblitt
b6ee7e40e5 compatibility fixes for ruby 1.8.7 / puppet 2.7 2013-10-23 12:18:09 -07:00
Joshua Hoblitt
4d7a915766 use $owner instead of $id to avoid confusion with $::id 2013-10-23 10:55:05 -07:00
Joshua Hoblitt
86522e1eb2 make class concat::setup a private class 2013-10-23 10:55:05 -07:00
Joshua Hoblitt
cca9401844 remove puppet 0.24 support
Introduction of stdlib functions makes support of puppet < 2.7
impractical.
2013-10-23 10:55:05 -07:00
Joshua Hoblitt
7b992f79e3 validate define concat::fragment params 2013-10-23 10:55:01 -07:00
Joshua Hoblitt
eaf8407941 validate define concat params + split warn param
In addition, the warn param has been split into a warn (a bool) and
warn_message (a string).
2013-10-23 10:48:34 -07:00
Joshua Hoblitt
e4a53b6755 remove unused $gnu param from define concat 2013-10-22 09:27:53 -07:00
Joshua Hoblitt
987eaec7ab improve whitespace consistency + remove semicolon resource compression
Per http://docs.puppetlabs.com/guides/style_guide.html#resources
resource compression with the "semicolon syntax" is now considered bad
practice.
2013-10-22 08:54:48 -07:00
Graham Bleach
fbb8f40594 Fix group ownership on files.
And add a test to stop it being broken again.
2013-10-22 12:36:19 +01:00
Joshua Hoblitt
cdb6d6b007 remove undocumented requirement to include concat::setup in manifest
Unless the class `concat::setup` has been manually included into the
manifest before using the `concat` / `concat::fragment` defined types,
the puppet master will generate this warning while compiling the catalog.

    Tue Oct 15 14:05:06 -0700 2013 Scope(Concat[/etc/exports]) (warning):
    Could not look up qualified variable 'concat::setup::root_group'; class
    concat::setup has not been evaluated

The need to `include concat::setup` directly into the manifest has never
been part of the documented API.
2013-10-17 15:07:57 -07:00
Aaron Blew
bb16039347 Help message for pluginsync now references the correct section of the config 2013-09-27 00:24:58 -07:00
Ashley Penney
bcf1f5407a Merge pull request #39 from FredericLespez/master
Add an $ensure parameter to concat
2013-09-24 15:35:25 -07:00
Ashley Penney
64c278490c Ensure that ::setup runs before ::fragment in all cases. 2013-09-24 17:12:27 -04:00
Frédéric Lespez
d05da952ca Add an ensure parameter to concat define
This parameter controls whether ressources associated to concat should be present or absent.
2013-08-19 16:19:57 +02:00
Tom McLaughlin
871e0b7de1 new_line -> newline 2013-08-08 16:25:32 -04:00
Tom McLaughlin
3defb6e1c1 Ability to control if fragments should always have a newline at the end. 2013-08-08 16:25:32 -04:00
Mark Chappell
688655eb7b RDoc cleanup 2013-05-10 11:58:02 +02:00
Maxence Dunnewind
8e83e57a29 remove unneeded ',' 2013-03-13 14:25:47 +01:00
Wijnand Modderman-Lenstra
4396d601d6 Move away from defining resource defaults, we can just pass $source and $content directly to the file resource
Using the case statement does not properly notify the file resource about
changes, leading to unexpected results when generating fragments from Puppet
templates. This patch fixes that issue.
2013-02-28 13:00:11 +01:00
Raphael Lorenzeto
4ec1d5df0d Adding more helpful message for 'pluginsync = true'. 2013-02-24 08:28:19 -03:00
Jasper Poppe
c854799c53 added description of replace in the comment block 2012-12-12 15:14:51 +01:00
Jasper Poppe
2f35c78a9e added (file) $replace parameter to concat 2012-12-12 14:33:47 +01:00
Marc Haber
8b3397bdd4 gracefully handle \n in fragment resource name 2012-11-06 10:54:35 +01:00
Jan Vansteenkiste
370e60280d Fixes various puppet-lint warnings.
* ./manifests/init.pp - WARNING: ensure found on line but it's not the first attribute on line 222
* ./manifests/setup.pp - WARNING: selector inside resource block on line 34
* ./manifests/fragment.pp - WARNING: case statement without a default case on line 28
2012-08-30 12:33:50 +02:00
Jan Vansteenkiste
6a0c1f9a39 Document the path parameter and provide a small use case. 2012-08-30 11:06:58 +02:00
Jan Vansteenkiste
3ac955e05d Allow overriding the target path of a (concat) file and use a custom name. 2012-08-30 10:09:28 +02:00
Andreas Jaggi
721ef012e2 Remove trailing whitespace in comment
puppet-lint does not like trailing whitespaces
2012-08-14 17:13:25 +02:00
R.I.Pienaar
a0661e1764 Merge pull request #27 from djmitche/auto-setup
Include concat::setup from concat, so users don't need to
2012-07-11 15:22:25 -07:00
Dustin J. Mitchell
0ba071858d Include concat::setup from concat, so users don't need to 2012-07-11 16:54:05 -05:00
Dustin J. Mitchell
092afd4193 Remove spurious 'e' character. 2012-07-11 16:46:12 -05:00
Paul Belanger
534fd8b7a4 Reformatting for puppet-lint
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
2012-06-23 17:45:57 -04:00
Sharif Nassar
21d0d2abf2 Fail with helpful advice if $::concat_basedir is not yet set
Building on the new docs in https://github.com/ripienaar/puppet-concat/pull/20
2012-05-23 14:35:08 -07:00
Gildas Le Nadan
0bbbe320cc add information about concat_basedir and the need for pluginsync = true at least once 2012-05-20 20:24:22 +02:00
Erik Dalén
800bec11ae Style guideline fixes
Comply better with puppet community style guidelines.

Change-Id: Ie1782d266539b1a8f9890b2ade77280011aa22aa
2012-04-24 16:53:20 +02:00
Reid Vandewiele
81d5ee80f3 Remove the gnu parameter from concat
Previously, the concatfragments.sh script was would default to using
GNU-specific flags for find, sort, and xargs. This necessitated
explicit passing of a "gnu = false" parameter to the concat define in
order to successfully run the script without GNU-specific flags when
working with systems that do not by default include GNU versions of the
utilities (solaris, for example).

This commit modifies the concatfragments script such that GNU versions
of the utilities are not needed at all. It does this while preserving
the original use case for the GNU flags, which was to allow special
characters (like spaces) in the filenames, which it accomplished by
using GNU flags to separate fields using null characters instead of
newlines.

In order to preserve backwards-compatibility with existing puppet
installations that make use of the "gnu = false" parameter, the
parameter list for the concat define has not been changed. Rather, the
gnu parameter is now deprecated and ignored.
2012-04-17 12:02:38 -07:00
Sharif Nassar
30c96286c9 Fix comments to match actual behavior, clean up old script.
* Zap the old copy of /usr/local/bin/concatfragments.sh.
* Fix comments to point at new location of script.
* Delete trailing whitespace.
2011-12-14 13:45:46 -08:00
Christian G. Warden
7722415753 Fix use of unqualified variable names
Fully qualify $::id, $::puppetversion, and $::concat_basedir.
2011-12-05 16:19:24 -08:00
Peter Meier
b9e33c4e6b finish work for unpriviledged user
To be able to use the module as an unprivileged user we need to
adjust certain things:

* only enforce the run user and group if we are root and can
  actually change the user
* set owner/group of our files and directories to our own user/group
* place the concat script in a location we can write -> use the
  concat dir for that.
2011-06-23 13:57:09 +02:00
Peter Meier
45dfa6984c don't use a hardcoded concatdir
Get the concat base directory from a fact -> makes it useable if
Puppet's :vardir is not /var/lib/puppet/. This fixes problems with
PE and makes the module also useable for puppet runs as
unpriviledged user.
2011-06-23 11:05:43 +02:00