Commit graph

53 commits

Author SHA1 Message Date
Morgan Haskel
7eb14b7768 Remove shell script
The ruby script works just as well and works on all supported platforms. No need to maintain both.
2015-02-13 13:16:59 -08:00
Colleen Murphy
a198e5db14 Fix validate_cmd file resource parameter
The validate_cmd parameter is only valid on newer versions of puppet.
This module is supporting all 3.x versions of puppet. This commit only
applies the validate_cmd parameter to the file resource if it is
defined and adds documentation noting that it will not work on older
versons of puppet.
2015-02-11 22:03:00 -08:00
Morgan Haskel
3a634af4aa Merge pull request #243 from jmkeyes/add-validation-command
Support running a validation command on the destination file.
2015-02-11 16:49:16 -08:00
Morgan Haskel
3b2e37ab1e MODULES-1456 - make sure ruby is in path on PE
Ruby is not in the path for all PE installations, so make sure the
concat script is run with ruby in the path.
2015-02-10 12:05:12 -08:00
Joshua M. Keyes
09a01d8087 Ensure validate_cmd is a string and fail explicitly otherwise. 2014-11-15 16:48:18 -08:00
Joshua M. Keyes
561935586d Support running a validation command on the destination file. 2014-11-12 19:25:01 -08:00
Geoff Williams
ed6efe8972 Reset poisoned defaults from Exec 2014-09-18 21:00:05 +10:00
Morgan Haskel
e015a1fdf7 Lack of idempotency with ensure => 'absent'
Need to add an unless to the exec in the case we have `ensure =>
'absent'` for the concat, otherwise the exec (of true) runs every time.
2014-09-08 14:24:29 -04:00
Morgan Haskel
3d167883dd Remove dependency on stdlib4 2014-09-05 16:26:21 -04:00
Axel Bock
b4e1c0c387 fix: permitting $backup to be a boolean value 2014-08-18 09:09:20 +02:00
Lucien Weller
a2f625f385 Added double quotes to paths in concat command, so that it does not fail when path of target file contains some blanks. 2014-02-24 15:02:32 +01:00
Ashley Penney
b07f338f29 Fix ensure => absent with path => set.
The current code doesn't correctly account for an absent with a
path set, incorrectly trying to remove $name instead.  Fixing this
raised the issue that fragments left with no ensure will fail when
absent is set as the fragdir is deleted.

As a workaround for this we check the `ensure` parameter from the
concat{} resource with getparam() and then pass that to the fragment
if no specific ensure was passed in.  This effectively ensures
fragments inherit their parents ensure status.
2014-01-21 16:28:42 -05:00
Joshua Hoblitt
8a500af5ee revert concat $warn/$warn_message param split + add deprecation warnings
Partially reverting the $warn/$warn_message param split from eaf8407 as this
change was unnecessarily API breaking.  Instead, we are adding string/bool type
validating to the $warn parameter and deprecation warnings for the usage of
stringified boolean values (eg, 'true', 'on', etc.). In a future major release,
the logic can be simplified to treating all string values as a warning message.
2013-12-23 13:23:49 -08:00
Michiel Brandenburg
2ef05a73fe Puppet 2.6.x compatibility 2013-11-12 11:36:34 +01:00
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
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
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
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
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
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
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
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
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
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
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
Pierre-Yves Ritschard
031bf26128 - make the root group configurable in the concat::setup class for portability
- use sh and not bash
2011-02-03 18:01:36 +00:00
Jonathan Boyett
fa80fc2b31 add a -g flag to concatfragments.sh to disable GNU extensions to find, sort and xargs; makes concat work on Solaris.
Add a $gnu parameter to make use of the aforementioned -g flag, and a $order parameter to make use of the -n flag in concatfragments.sh
2010-12-03 12:35:23 -08:00
martin f. krafft
af63a0b3eb Parametrize warning message
The concat warn parameter can now be any string (and needs to include
the appropriate commenting character) and will then override the default
(which still gets printed when warn=>true).

Signed-off-by: martin f. krafft <madduck@madduck.net>
2010-10-04 22:46:18 +01:00