Merge pull request #44 from enovance/bug/40/sbadia
[loadbalancer] Bug: Fix puppet source (closes: #40)
This commit is contained in:
commit
b4683ded87
@ -78,7 +78,7 @@ class cloud::loadbalancer(
|
|||||||
|
|
||||||
file { '/etc/logrotate.d/haproxy':
|
file { '/etc/logrotate.d/haproxy':
|
||||||
ensure => file,
|
ensure => file,
|
||||||
source => 'puppet:///cloud/logrotate/haproxy',
|
source => 'puppet:///modules/cloud/logrotate/haproxy',
|
||||||
owner => root,
|
owner => root,
|
||||||
group => root,
|
group => root,
|
||||||
mode => '0644';
|
mode => '0644';
|
||||||
|
@ -39,6 +39,7 @@ describe 'cloud::loadbalancer' do
|
|||||||
:horizon => true,
|
:horizon => true,
|
||||||
:spice => true,
|
:spice => true,
|
||||||
:haproxy_auth => 'root:secrete',
|
:haproxy_auth => 'root:secrete',
|
||||||
|
:keepalived_state => 'BACKUP',
|
||||||
:keepalived_priority => 50,
|
:keepalived_priority => 50,
|
||||||
:keepalived_interface => 'eth0',
|
:keepalived_interface => 'eth0',
|
||||||
:keepalived_ipvs => ['10.0.0.1', '10.0.0.2'],
|
:keepalived_ipvs => ['10.0.0.1', '10.0.0.2'],
|
||||||
@ -66,24 +67,24 @@ describe 'cloud::loadbalancer' do
|
|||||||
should contain_class('haproxy').with({
|
should contain_class('haproxy').with({
|
||||||
'manage_service' => 'false',
|
'manage_service' => 'false',
|
||||||
})
|
})
|
||||||
end
|
end # configure haproxy server
|
||||||
|
|
||||||
it 'configure keepalived server' do
|
it 'configure keepalived server' do
|
||||||
should contain_class('keepalived')
|
should contain_class('keepalived')
|
||||||
end
|
end # configure keepalived server
|
||||||
|
|
||||||
context 'configure keepalived in backup' do
|
context 'configure keepalived in backup' do
|
||||||
it 'configure vrrp_instance with BACKUP state' do
|
it 'configure vrrp_instance with BACKUP state' do
|
||||||
should contain_keepalived__instance('1').with({
|
should contain_keepalived__instance('1').with({
|
||||||
'interface' => 'eth0',
|
'interface' => params[:keepalived_interface],
|
||||||
'track_script' => ['haproxy'],
|
'track_script' => ['haproxy'],
|
||||||
'state' => 'BACKUP',
|
'state' => params[:keepalived_state],
|
||||||
'priority' => 50,
|
'priority' => params[:keepalived_priority],
|
||||||
'notify_master' => '"/etc/init.d/haproxy start"',
|
'notify_master' => '"/etc/init.d/haproxy start"',
|
||||||
'notify_backup' => '"/etc/init.d/haproxy stop"',
|
'notify_backup' => '"/etc/init.d/haproxy stop"',
|
||||||
})
|
})
|
||||||
end
|
end # configure vrrp_instance with BACKUP state
|
||||||
end
|
end # configure keepalived in backup
|
||||||
|
|
||||||
context 'configure keepalived in master' do
|
context 'configure keepalived in master' do
|
||||||
before :each do
|
before :each do
|
||||||
@ -91,17 +92,47 @@ describe 'cloud::loadbalancer' do
|
|||||||
end
|
end
|
||||||
it 'configure vrrp_instance with MASTER state' do
|
it 'configure vrrp_instance with MASTER state' do
|
||||||
should contain_keepalived__instance('1').with({
|
should contain_keepalived__instance('1').with({
|
||||||
'interface' => 'eth0',
|
'interface' => params[:keepalived_interface],
|
||||||
'track_script' => ['haproxy'],
|
'track_script' => ['haproxy'],
|
||||||
'state' => 'MASTER',
|
'state' => 'MASTER',
|
||||||
'priority' => 50,
|
'priority' => params[:keepalived_priority],
|
||||||
'notify_master' => '"/etc/init.d/haproxy start"',
|
'notify_master' => '"/etc/init.d/haproxy start"',
|
||||||
'notify_backup' => '"/etc/init.d/haproxy stop"',
|
'notify_backup' => '"/etc/init.d/haproxy stop"',
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end # configure keepalived in master
|
||||||
|
|
||||||
end
|
context 'configure logrotate file' do
|
||||||
|
it { should contain_file('/etc/logrotate.d/haproxy').with(
|
||||||
|
:source => 'puppet:///modules/cloud/logrotate/haproxy',
|
||||||
|
:mode => '0644',
|
||||||
|
:owner => 'root',
|
||||||
|
:group => 'root'
|
||||||
|
)}
|
||||||
|
end # configure logrotate file
|
||||||
|
|
||||||
|
context 'configure monitor haproxy listen' do
|
||||||
|
it { should contain_haproxy__listen('monitor').with(
|
||||||
|
:ipaddress => params[:openstack_vip],
|
||||||
|
:ports => '9300'
|
||||||
|
)}
|
||||||
|
end # configure monitor haproxy listen
|
||||||
|
|
||||||
|
context 'configure monitor haproxy listen' do
|
||||||
|
it { should contain_haproxy__listen('galera_cluster').with(
|
||||||
|
:ipaddress => params[:mysql_vip],
|
||||||
|
:ports => '3306',
|
||||||
|
:options => {
|
||||||
|
'mode' => 'tcp',
|
||||||
|
'balance' => 'roundrobin',
|
||||||
|
'option' => ['tcpka','tcplog','httpchk'],
|
||||||
|
'timeout client' => '400s',
|
||||||
|
'timeout server' => '400s'
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
end # configure monitor haproxy listen
|
||||||
|
|
||||||
|
end # shared:: openstack loadbalancer
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
context 'on Debian platforms' do
|
||||||
let :facts do
|
let :facts do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user