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
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
- 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.
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.
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).
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.
* ./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
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.
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.
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>