Skip to content

Commit 6fe2378

Browse files
authored
Merge pull request #247 from Xylakant/feature/fasrc-ha_setup_onegate_oneflow
Feature/fasrc ha setup onegate oneflow
2 parents c28b9e6 + 540dd53 commit 6fe2378

3 files changed

Lines changed: 35 additions & 5 deletions

File tree

manifests/oned/oneflow/service.pp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,18 @@
1717
# http://www.apache.org/licenses/LICENSE-2.0.html
1818
#
1919
class one::oned::oneflow::service {
20+
21+
if ($one::ha_setup) {
22+
$oneflow_enable = false
23+
$oneflow_ensure = undef
24+
} else {
25+
$oneflow_enable = true
26+
$oneflow_ensure = running
27+
}
28+
2029
service {'opennebula-flow':
21-
ensure => running,
22-
enable => true,
30+
ensure => $oneflow_ensure,
31+
enable => $oneflow_enable,
2332
require => Service['opennebula'],
2433
}
2534
}

manifests/oned/onegate/service.pp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,18 @@
1717
# http://www.apache.org/licenses/LICENSE-2.0.html
1818
#
1919
class one::oned::onegate::service {
20+
21+
if ($one::ha_setup) {
22+
$onegate_enable = false
23+
$onegate_ensure = undef
24+
} else {
25+
$onegate_enable = true
26+
$onegate_ensure = running
27+
}
28+
2029
service {'opennebula-gate':
21-
ensure => running,
22-
enable => true,
30+
ensure => $onegate_ensure,
31+
enable => $onegate_enable,
2332
require => Service['opennebula'],
2433
}
2534
}

spec/classes/opennebula_spec.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,18 @@
286286
#it { should contain_package('parse-cron') }
287287
end
288288
it { should contain_service('opennebula-gate').with_ensure('running') }
289+
context 'with ha-setup' do
290+
let(:params) { {
291+
:onegate => true,
292+
:oneflow => true,
293+
:ha_setup => true
294+
} }
295+
it { should contain_class('one::oned::onegate') }
296+
it { should contain_service('opennebula-flow').with_enable(false) }
297+
it { should contain_service('opennebula-flow').without_ensure }
298+
it { should contain_service('opennebula-gate').with_enable(false) }
299+
it { should contain_service('opennebula-gate').without_ensure }
300+
end
289301
end
290302
context 'with sunstone' do
291303
let(:params) { {
@@ -338,7 +350,7 @@
338350
let(:params) { {
339351
:oned => true,
340352
:sunstone => true,
341-
:ha_setup => true,
353+
:ha_setup => true
342354
} }
343355
it { should contain_service('opennebula').with_enable('false') }
344356
it { should contain_service('opennebula-sunstone').with_ensure('running') }

0 commit comments

Comments
 (0)