]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/concat/manifests/setup.pp
try if downgrading to 1.2.2 solves my problem
[dsa-puppet.git] / 3rdparty / modules / concat / manifests / setup.pp
1 # === Class: concat::setup
2 #
3 # Sets up the concat system. This is a private class.
4 #
5 # [$concatdir]
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.
9 #
10 # It also copies out the concatfragments.{sh,rb} file to ${concatdir}/bin
11 #
12 class concat::setup {
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.")
15   }
16
17   if $::concat_basedir {
18     $concatdir = $::concat_basedir
19   } else {
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\'.')
21   }
22
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
30   } else {
31     $fragment_group = undef
32   }
33
34   $script_name = 'concatfragments.rb'
35
36   $script_path = "${concatdir}/bin/${script_name}"
37
38   $default_owner = $::osfamily ? { 'windows' => undef, default => $::id }
39
40   $default_group = $default_owner ? { 'root' => '0', default => undef }
41
42   $script_mode = $::osfamily ? { 'windows' => undef, default => '0755' }
43
44   $script_command = $::osfamily? {
45     'windows' => "ruby.exe '${script_path}'",
46     'openbsd' => "/usr/local/bin/ruby21 '${script_path}'",
47     default   => $script_path
48   }
49
50   file { $script_path:
51     ensure => file,
52     owner  => $default_owner,
53     group  => $default_group,
54     mode   => $script_mode,
55     source => "puppet:///modules/concat/${script_name}",
56   }
57
58   file { [ $concatdir, "${concatdir}/bin" ]:
59     ensure => directory,
60     owner  => $default_owner,
61     group  => $default_group,
62     mode   => '0755',
63   }
64 }