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
#
2011-12-14 22:45:06 +01:00
# It also copies out the concatfragments. sh 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
}
2013-09-02 13:49:40 +02:00
$ script_name = $ : : kernel ? {
'windows' = > "concatfragments.rb" ,
default = > "concatfragments.sh"
}
$ script_path = "${concatdir}/bin/${script_name}"
$ script_command = $ : : kernel ? {
'windows' = > "ruby.exe ${script_path}" ,
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:
2012-03-14 18:02:43 +01:00
mode = > '0755' ,
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
}