2013-05-09 21:24:22 +02:00
# = = = Class : concat: : setup
#
2013-10-23 19:34:44 +02:00
# Sets up the concat system. This is a private class .
2010-05-06 23:55:02 +02:00
#
2013-05-09 21:24:22 +02:00
# [ $c oncatdir]
# is where the fragments live and is set on the fact concat_basedir.
# Since puppet should always manage files in $c oncatdir and they should
# not be deleted ever, / tmp is not an option.
2010-05-06 23:55:02 +02:00
#
2014-05-28 18:31:02 +02:00
# It also copies out the concatfragments. {sh,rb} file to $ {concatdir} / bin
2013-05-09 21:24:22 +02:00
#
2010-05-06 23:55:02 +02:00
class concat: : setup {
2013-10-23 19:34:44 +02:00
if $ca ller_module_name ! = $ module_name {
2013-10-29 23:39:54 +01:00
warning( "${name} is deprecated as a public API of the ${module_name} module and should no longer be directly included in the manifest." )
2013-10-23 19:34:44 +02:00
}
2012-05-23 23:35:08 +02:00
if $ : : concat_basedir {
$c oncatdir = $ : : concat_basedir
} else {
2013-10-22 17:53:18 +02:00
fail ( '$concat_basedir not defined. Try running again with pluginsync=true on the [master] and/or [main] section of your node\' s \ '/etc/puppet/puppet.conf\' . ' )
2012-05-23 23:35:08 +02:00
}
2014-05-28 18:31:02 +02:00
# owner and mode of fragment files ( on windows owner and access rights should
# be inherited from concatdir and not explicitly set to avoid problems)
$f ragment_owner = $ : : osfamily ? { 'windows' => undef, default => $::id }
$f ragment_mode = $ : : osfamily ? { 'windows' => undef, default => '0640' }
# PR #174 introduced changes to the concatfragments. sh script that are
# incompatible with Solaris 1 0 but reportedly OK on Solaris 1 1 . As a work
# around we are enable the . rb concat script on all Solaris versions. If
# this goes smoothly, we should move towards completely eliminating the . sh
# version.
$ script_name = $ : : osfamily? {
2014-11-18 13:55:53 +01:00
/ ( ? i: ( Windows| Solaris| AIX) ) / = > 'concatfragments.rb' ,
default = > 'concatfragments.sh'
2013-09-02 13:49:40 +02:00
}
$ script_path = "${concatdir}/bin/${script_name}"
2014-05-28 18:31:02 +02:00
$ script_owner = $ : : osfamily ? { 'windows' => undef, default => $::id }
2014-02-21 19:36:52 +01:00
2014-05-28 18:31:02 +02:00
$ script_mode = $ : : osfamily ? { 'windows' => undef, default => '0755' }
2014-02-21 19:36:52 +01:00
2014-05-28 18:31:02 +02:00
$ script_command = $ : : osfamily? {
2014-06-18 09:09:47 +02:00
'windows' = > "ruby.exe '${script_path}'" ,
2013-09-02 13:49:40 +02:00
default = > $ script_path
}
2013-10-24 00:42:44 +02:00
File {
backup = > false ,
}
2013-09-02 13:49:40 +02:00
file { $ script_path:
2013-11-02 02:20:41 +01:00
ensure = > file ,
2014-02-21 19:36:52 +01:00
owner = > $ script_owner,
mode = > $ script_mode,
2013-09-02 13:49:40 +02:00
source = > "puppet:///modules/concat/${script_name}" ,
2013-10-22 17:53:18 +02:00
}
2010-05-06 23:55:02 +02:00
2013-10-22 17:53:18 +02:00
file { [ $concatdir, "${concatdir} / bin" ] :
2012-03-14 18:02:43 +01:00
ensure = > directory,
2013-10-24 17:48:37 +02:00
mode = > '0755' ,
2013-10-22 17:53:18 +02:00
}
2010-05-06 23:55:02 +02:00
}