|
48 | 48 | $real_options = $options_defaults + $options
|
49 | 49 |
|
50 | 50 | $real_ruby_path = $ruby_path ? {
|
51 |
| - undef => $facts['aio_agent_version'] ? { |
| 51 | + undef => getvar('facts.aio_agent_version') ? { |
52 | 52 | undef => '/usr/bin/env ruby',
|
53 | 53 | '' => '/usr/bin/env ruby',
|
54 | 54 | default => $facts['os']['family'] ? {
|
|
61 | 61 |
|
62 | 62 | File {
|
63 | 63 | ensure => $file_ensure,
|
64 |
| - mode => $real_tp_params['mode'], |
65 |
| - owner => $real_tp_params['owner'], |
66 |
| - group => $real_tp_params['group'], |
| 64 | + mode => $tp::tp_dirs_mode, |
| 65 | + owner => $tp::tp_dirs_owner, |
| 66 | + group => $tp::tp_dirs_group, |
67 | 67 | }
|
68 | 68 |
|
69 |
| - if $cli_enable { |
70 |
| - $dirs = [$tp::tp_dir , "${tp::tp_dir}/app" , "${tp::tp_dir}/shellvars" , "${tp::tp_dir}/test", "${tp::tp_dir}/info", "${tp::tp_dir}/debug"] |
71 |
| - $dirs.each | $d | { |
72 |
| - file { $d: |
73 |
| - ensure => $dir_ensure, |
74 |
| - purge => $purge_dirs, |
75 |
| - force => $purge_dirs, |
76 |
| - recurse => $purge_dirs, |
77 |
| - } |
| 69 | + $dirs = [$tp::tp_dir , "${tp::tp_dir}/app" , "${tp::tp_dir}/shellvars" , "${tp::tp_dir}/test", "${tp::tp_dir}/info", "${tp::tp_dir}/debug"] |
| 70 | + $dirs.each | $d | { |
| 71 | + file { $d: |
| 72 | + ensure => $dir_ensure, |
| 73 | + purge => $purge_dirs, |
| 74 | + force => $purge_dirs, |
| 75 | + recurse => $purge_dirs, |
78 | 76 | }
|
79 |
| - $work_dirs = [$tp::data_dir, $tp::download_dir , $tp::extract_dir , $tp::flags_dir] |
80 |
| - $work_dirs.each | $d | { |
81 |
| - file { $d: |
82 |
| - ensure => $dir_ensure, |
| 77 | + } |
| 78 | + $work_dirs = [$tp::data_dir, $tp::download_dir , $tp::extract_dir , $tp::flags_dir] |
| 79 | + $work_dirs.each | $d | { |
| 80 | + file { $d: |
| 81 | + ensure => $dir_ensure, |
83 | 82 | # purge => $purge_dirs,
|
84 | 83 | # force => $purge_dirs,
|
85 | 84 | # recurse => $purge_dirs,
|
86 |
| - } |
87 |
| - } |
88 |
| - $epp_params = { |
89 |
| - 'real_ruby_path' => $real_ruby_path, |
90 |
| - 'options' => $real_options, |
91 |
| - 'suppress_tp_warnings' => $suppress_tp_warnings, |
92 |
| - 'suppress_tp_output' => $suppress_tp_output, |
93 |
| - 'tp_dir' => $tp::tp_dir, |
94 |
| - } |
95 |
| - file { $tp::tp_path: |
96 |
| - path => $tp::tp_path, |
97 |
| - content => epp('tp/tp.epp', $epp_params), |
98 |
| - } |
99 |
| - |
100 |
| - if $facts['os']['family'] == 'windows' { |
101 |
| - file { "${tp::tp_path}.bat": |
102 |
| - content => epp('tp/tp.bat.epp'), |
103 |
| - } |
104 |
| - } else { |
105 |
| - file { '/usr/sbin/tp': |
106 |
| - ensure => link, |
107 |
| - target => $tp::tp_path, |
108 |
| - } |
109 | 85 | }
|
| 86 | + } |
| 87 | + $epp_params = { |
| 88 | + 'real_ruby_path' => $real_ruby_path, |
| 89 | + 'options' => $real_options, |
| 90 | + 'suppress_tp_warnings' => $suppress_tp_warnings, |
| 91 | + 'suppress_tp_output' => $suppress_tp_output, |
| 92 | + 'tp_dir' => $tp::tp_dir, |
| 93 | + } |
| 94 | + file { $tp::tp_path: |
| 95 | + path => $tp::tp_path, |
| 96 | + content => epp('tp/tp.epp', $epp_params), |
| 97 | + } |
110 | 98 |
|
111 |
| - file { 'bin dir': |
112 |
| - ensure => $dir_ensure, |
113 |
| - path => "${tp::tp_dir}/bin", |
114 |
| - source => $real_tp_params['bin']['args']['source'], |
115 |
| - recurse => true, |
116 |
| - } |
117 |
| - file { 'info scripts': |
118 |
| - ensure => $dir_ensure, |
119 |
| - path => "${tp::tp_dir}/bin/run_info", |
120 |
| - source => $info_source, |
121 |
| - recurse => true, |
| 99 | + if $facts['os']['family'] == 'windows' { |
| 100 | + file { "${tp::tp_path}.bat": |
| 101 | + content => epp('tp/tp.bat.epp'), |
122 | 102 | }
|
123 |
| - file { 'package_info': |
124 |
| - mode => '0755', |
125 |
| - path => "${tp::tp_dir}/bin/run_info/package_info", |
126 |
| - content => epp('tp/run_info/package_info.epp'), |
| 103 | + } else { |
| 104 | + file { '/usr/sbin/tp': |
| 105 | + ensure => link, |
| 106 | + target => $tp::tp_path, |
127 | 107 | }
|
| 108 | + } |
128 | 109 |
|
129 |
| - file { $info_script_path: |
130 |
| - mode => '0755', |
131 |
| - path => $info_script_path, |
132 |
| - content => epp($info_script_template, { 'options' => $real_options }), |
133 |
| - } |
| 110 | + file { 'bin dir': |
| 111 | + ensure => $dir_ensure, |
| 112 | + path => "${tp::tp_dir}/bin", |
| 113 | + source => $real_tp_params['bin']['args']['source'], |
| 114 | + recurse => true, |
| 115 | + } |
| 116 | + file { 'info scripts': |
| 117 | + ensure => $dir_ensure, |
| 118 | + path => "${tp::tp_dir}/bin/run_info", |
| 119 | + source => $info_source, |
| 120 | + recurse => true, |
| 121 | + } |
| 122 | + file { 'package_info': |
| 123 | + mode => '0755', |
| 124 | + path => "${tp::tp_dir}/bin/run_info/package_info", |
| 125 | + content => epp('tp/run_info/package_info.epp'), |
| 126 | + } |
134 | 127 |
|
135 |
| - file { 'debug scripts': |
136 |
| - ensure => $dir_ensure, |
137 |
| - path => "${tp::tp_dir}/bin/run_debug", |
138 |
| - source => $debug_source, |
139 |
| - } |
140 |
| - file { 'package_debug': |
141 |
| - mode => '0755', |
142 |
| - path => "${tp::tp_dir}/bin/run_debug/package_debug", |
143 |
| - content => epp('tp/run_debug/package_debug.epp'), |
144 |
| - } |
145 |
| - file { $debug_script_path: |
146 |
| - mode => '0755', |
147 |
| - path => $debug_script_path, |
148 |
| - content => epp($debug_script_template, { 'options' => $real_options }), |
149 |
| - } |
| 128 | + file { $info_script_path: |
| 129 | + mode => '0755', |
| 130 | + path => $info_script_path, |
| 131 | + content => epp($info_script_template, { 'options' => $real_options }), |
| 132 | + } |
| 133 | + |
| 134 | + file { 'debug scripts': |
| 135 | + ensure => $dir_ensure, |
| 136 | + path => "${tp::tp_dir}/bin/run_debug", |
| 137 | + source => $debug_source, |
| 138 | + } |
| 139 | + file { 'package_debug': |
| 140 | + mode => '0755', |
| 141 | + path => "${tp::tp_dir}/bin/run_debug/package_debug", |
| 142 | + content => epp('tp/run_debug/package_debug.epp'), |
| 143 | + } |
| 144 | + file { $debug_script_path: |
| 145 | + mode => '0755', |
| 146 | + path => $debug_script_path, |
| 147 | + content => epp($debug_script_template, { 'options' => $real_options }), |
150 | 148 | }
|
151 | 149 | }
|
152 | 150 | }
|
0 commit comments