Commit graph

80 commits

Author SHA1 Message Date
Toni Schmidbauer
4fc1dfc462 use concatfragments.rb on AIX
AIX find does not support the print0 option. It's basically the same as on Solaris:

Debug: Executing '/var/lib/puppet/concat/bin/concatfragments.sh -o "/var/lib/puppet/concat/_var_ossec_etc_ossec-agent.conf/fragments.concat.out" -d "/var/lib/puppet/concat/_var_ossec_etc_ossec-agent.conf" -t'
Debug: /Stage[main]/Ossec::Client/Concat[/var/ossec/etc/ossec-agent.conf]/Exec[concat_/var/ossec/etc/ossec-agent.conf]/unless: find: bad option -print0
2014-11-18 13:55:53 +01: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
Neil Prockter
ca8e036bac ensure concat file fragments are always replaced 2014-08-02 00:18:16 +01:00
Tomas Doran
8e6fe8c459 Fix errors with the future parser.
Error: Illegal name. The given name _ensure does not conform to the naming rule \A((::)?[a-z0-9]w*)(::[a-z0-9]w*)*\z at /etc/puppet/vendor/modules/concat/manifests/fragment.pp:57:5
2014-07-10 18:35:12 -04:00
Geoff Williams
0ce713fd9c fix concat broken on windows due to case sensitive regexp -- made it case insensitive 2014-07-09 13:45:16 +10:00
Luis Fernandez Alvarez
da59390ed2 Add quotes to the ruby script location
Without this patch, if the ruby script is located in a path with
spaces, it will not work.
2014-06-18 09:09:47 +02:00
Joshua Hoblitt
8dedb6bffb Validate the concat::fragment order parameter as string||integer
This is to work around a validation issue that arises under the 3.x future
parser, as proper numeric types have been introduced (ie, not all scalar values
are strings).  Users have come to expect to to be able to pass in unquoted
integer values to the order parameter which will fail to validate as a string
when the future parser is enabled.
2014-05-29 13:07:16 -07:00
Joshua Hoblitt
a4abf6f142 enable the ruby concat script on Solaris
Per discussion on #174, Solaris 10 does not support the find/xargs
switches that were introduced in that PR (but Solaris 11 does).

+ add a shebang to concatfragments.rb
+ fix linter warnings/errors
2014-05-29 12:52:38 -07:00
Mike Dorman
cd645a8360 Change default 'order' parameter to be a string
Under Puppet 3.5.1 (and possibly earlier versions, too), the validate_string($order)
fails when $order is actaully a numeric type.  Apparently there is more strict type
checking now.  Can't just change validate_string to a is_numeric check, because it's
fairly common to use strings like '01' for the order parameter, which doesn't pass
the is_numeric test.  Additionally, there is nothing saying that $order must be a
number.  Ultimately the ordering gets implemented as filesystem directory list
sorting.
2014-05-21 17:06:37 -06:00
Lucien Weller
e154e8d8f3 ignore mode an owner on windows 2014-04-04 11:03:25 +02:00
Ashley Penney
3b1bbb4873 Merge pull request #150 from lweller/issue_149
added double quotes to paths in concat command
2014-04-03 13:06:27 -04:00
Pi3r
d6b11cd502 Use explicit undef in else case
This is better than leaving it "unset".
2014-02-25 14:54:09 +01: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
Joshua Hoblitt
41d5d4ccd1 fix regression preventing usage of fragment ensure => /target syntax
Also fix a historical bug that prevents a fragment from being converted
from a symlink to using a source or content parameter.
2013-12-05 22:39:23 -07:00
Joshua Hoblitt
ba9501c1a0 allow source param to concat::fragment to be a string or an Array
This is resolve a regression preventing an array of string(s) being passed to the fragment file resource's source parameter.
2013-11-12 23:20:48 -07:00
Michiel Brandenburg
2ef05a73fe Puppet 2.6.x compatibility 2013-11-12 11:36:34 +01:00
Joshua Hoblitt
1a926b933c deprecate concat::fragment mode, owner, & group params
There's no need to allow the ownership/permissions of a fragment to be set as
the concat define sets ownership/permissions on the final aggregated file.
2013-11-02 13:39:12 -07: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
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