|
104 | 104 | if getvar('::gluster_binary') { |
105 | 105 | # we need the Gluster binary to do anything! |
106 | 106 |
|
107 | | - if getvar('::gluster_volume_list') and member( split( $::gluster_volume_list, ',' ), $title ) { |
| 107 | + if $facts['gluster_volume_list'] and member( split( $facts['gluster_volume_list'], ',' ), $title ) { |
108 | 108 | $already_exists = true |
109 | 109 | } else { |
110 | 110 | $already_exists = false |
|
116 | 116 | # nothing to do if volume does not exist and it should be absent |
117 | 117 | if $ensure == 'present' { |
118 | 118 | exec { "gluster create volume ${title}": |
119 | | - command => "${::gluster_binary} volume create ${title} ${args}", |
| 119 | + command => "${facts['gluster_binary']} volume create ${title} ${args}", |
120 | 120 | } |
121 | 121 |
|
122 | 122 | # if we have volume options, activate them now |
|
153 | 153 |
|
154 | 154 | # don't forget to start the new volume! |
155 | 155 | exec { "gluster start volume ${title}": |
156 | | - command => "${::gluster_binary} volume start ${title}", |
| 156 | + command => "${facts['gluster_binary']} volume start ${title}", |
157 | 157 | require => Exec["gluster create volume ${title}"], |
158 | 158 | } |
159 | 159 | } |
|
198 | 198 |
|
199 | 199 | $new_bricks_list = join($new_bricks, ' ') |
200 | 200 | exec { "gluster add bricks to ${title}": |
201 | | - command => "${::gluster_binary} volume add-brick ${title} ${s} ${r} ${new_bricks_list} ${_force}", |
| 201 | + command => "${facts['gluster_binary']} volume add-brick ${title} ${s} ${r} ${new_bricks_list} ${_force}", |
202 | 202 | } |
203 | 203 |
|
204 | 204 | if $rebalance { |
205 | 205 | exec { "gluster rebalance ${title}": |
206 | | - command => "${::gluster_binary} volume rebalance ${title} start", |
| 206 | + command => "${facts['gluster_binary']} volume rebalance ${title} start", |
207 | 207 | require => Exec["gluster add bricks to ${title}"], |
208 | 208 | } |
209 | 209 | } |
|
213 | 213 | # the self heal daemon comes back to life. |
214 | 214 | # as such, we sleep 5 here before starting the heal |
215 | 215 | exec { "gluster heal ${title}": |
216 | | - command => "/bin/sleep 5; ${::gluster_binary} volume heal ${title} full", |
| 216 | + command => "/bin/sleep 5; ${facts['gluster_binary']} volume heal ${title} full", |
217 | 217 | require => Exec["gluster add bricks to ${title}"], |
218 | 218 | } |
219 | 219 | } |
|
273 | 273 | } else { |
274 | 274 | # stop and remove volume |
275 | 275 | exec { "gluster stop and remove ${title}": |
276 | | - command => "/bin/yes | ( ${::gluster_binary} volume stop ${title} force && ${::gluster_binary} volume delete ${title} )", |
| 276 | + command => "/bin/yes | ( ${facts['gluster_binary']} volume stop ${title} force && ${facts['gluster_binary']} volume delete ${title} )", |
277 | 277 | } |
278 | 278 | } |
279 | 279 | } |
|
0 commit comments