1 # === Class: concat::setup
3 # Sets up the concat system. This is a private class.
6 # is where the fragments live and is set on the fact concat_basedir.
7 # Since puppet should always manage files in $concatdir and they should
8 # not be deleted ever, /tmp is not an option.
10 # It also copies out the concatfragments.{sh,rb} file to ${concatdir}/bin
13 if $caller_module_name != $module_name {
14 warning("${name} is deprecated as a public API of the ${module_name} module and should no longer be directly included in the manifest.")
17 if $::concat_basedir {
18 $concatdir = $::concat_basedir
20 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\'.')
23 # owner,group and mode of fragment files (on windows owner and access rights should
24 # be inherited from concatdir and not explicitly set to avoid problems)
25 $fragment_owner = $::osfamily ? { 'windows' => undef, default => $::id }
26 $fragment_mode = $::osfamily ? { 'windows' => undef, default => '0640' }
27 # test on gid fact availability to support older facter versions
28 if defined('$gid') and $::gid and $::osfamily != 'Windows' {
29 $fragment_group = $::gid
31 $fragment_group = undef
34 $script_name = 'concatfragments.rb'
36 $script_path = "${concatdir}/bin/${script_name}"
38 $default_owner = $::osfamily ? { 'windows' => undef, default => $::id }
40 $default_group = $default_owner ? { 'root' => '0', default => undef }
42 $script_mode = $::osfamily ? { 'windows' => undef, default => '0755' }
44 $script_command = $::osfamily? {
45 'windows' => "ruby.exe '${script_path}'",
46 'openbsd' => "/usr/local/bin/ruby21 '${script_path}'",
47 default => $script_path
52 owner => $default_owner,
53 group => $default_group,
55 source => "puppet:///modules/concat/${script_name}",
58 file { [ $concatdir, "${concatdir}/bin" ]:
60 owner => $default_owner,
61 group => $default_group,