cloud::spof: add red hat support
Use another puppet module to configure Pacemaker with Corosync and allow to run Ceilometer Agent Central and Heat Engine in HA on Red Hat systems.
This commit is contained in:
@@ -110,6 +110,9 @@ mod 'mysql',
|
|||||||
mod 'ntp',
|
mod 'ntp',
|
||||||
:git => 'git://github.com/enovance/puppetlabs-ntp.git',
|
:git => 'git://github.com/enovance/puppetlabs-ntp.git',
|
||||||
:ref => 'eb02ba2937ce86fb609ae41499767244b78ec58d'
|
:ref => 'eb02ba2937ce86fb609ae41499767244b78ec58d'
|
||||||
|
mod 'pacemaker',
|
||||||
|
:git => 'git://github.com/enovance/puppet-pacemaker.git',
|
||||||
|
:ref => '1102d9861d8a63cc1577bc97a4415b9ff7488038'
|
||||||
mod 'rabbitmq',
|
mod 'rabbitmq',
|
||||||
:git => 'git://github.com/enovance/puppetlabs-rabbitmq.git',
|
:git => 'git://github.com/enovance/puppetlabs-rabbitmq.git',
|
||||||
:ref => '25420cb3c26c9a8432ab519d43c094d614d4fec4'
|
:ref => '25420cb3c26c9a8432ab519d43c094d614d4fec4'
|
||||||
|
|||||||
@@ -23,6 +23,11 @@
|
|||||||
# (optional) Interface used by Corosync to send multicast traffic
|
# (optional) Interface used by Corosync to send multicast traffic
|
||||||
# Defaults to '127.0.0.1'
|
# Defaults to '127.0.0.1'
|
||||||
#
|
#
|
||||||
|
# [*cluster_members*]
|
||||||
|
# (required) Members of the cluster.
|
||||||
|
# Should be an array
|
||||||
|
# Defaults to ['127.0.0.1']
|
||||||
|
#
|
||||||
# [*multicast_address*]
|
# [*multicast_address*]
|
||||||
# (optionnal) IP address used to send multicast traffic
|
# (optionnal) IP address used to send multicast traffic
|
||||||
# Defaults to '239.1.1.2'
|
# Defaults to '239.1.1.2'
|
||||||
@@ -30,73 +35,109 @@
|
|||||||
|
|
||||||
class cloud::spof(
|
class cloud::spof(
|
||||||
$cluster_ip = '127.0.0.1',
|
$cluster_ip = '127.0.0.1',
|
||||||
|
$cluster_members = false,
|
||||||
$multicast_address = '239.1.1.2'
|
$multicast_address = '239.1.1.2'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
class { 'corosync':
|
if $::operatingsystem == 'RedHat' {
|
||||||
enable_secauth => false,
|
if ! $cluster_members {
|
||||||
authkey => '/var/lib/puppet/ssl/certs/ca.pem',
|
fail('cluster_members is a required parameter.')
|
||||||
bind_address => $cluster_ip,
|
|
||||||
multicast_address => $multicast_address
|
|
||||||
}
|
|
||||||
|
|
||||||
corosync::service { 'pacemaker':
|
|
||||||
version => '0',
|
|
||||||
}
|
|
||||||
|
|
||||||
Package['corosync'] ->
|
|
||||||
cs_property {
|
|
||||||
'no-quorum-policy': value => 'ignore';
|
|
||||||
'stonith-enabled': value => 'false';
|
|
||||||
'pe-warn-series-max': value => 1000;
|
|
||||||
'pe-input-series-max': value => 1000;
|
|
||||||
'cluster-recheck-interval': value => '5min';
|
|
||||||
} ->
|
|
||||||
file { '/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central':
|
|
||||||
source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central',
|
|
||||||
mode => '0755',
|
|
||||||
owner => 'root',
|
|
||||||
group => 'root',
|
|
||||||
} ->
|
|
||||||
cs_primitive { 'ceilometer-agent-central':
|
|
||||||
primitive_class => 'ocf',
|
|
||||||
primitive_type => 'ceilometer-agent-central',
|
|
||||||
provided_by => 'heartbeat',
|
|
||||||
operations => {
|
|
||||||
'monitor' => {
|
|
||||||
interval => '10s',
|
|
||||||
timeout => '30s'
|
|
||||||
},
|
|
||||||
'start' => {
|
|
||||||
interval => '0',
|
|
||||||
timeout => '30s',
|
|
||||||
on-fail => 'restart'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} ->
|
|
||||||
file { '/usr/lib/ocf/resource.d/heartbeat/heat-engine':
|
class { 'pacemaker::corosync':
|
||||||
source => 'puppet:///modules/cloud/heartbeat/heat-engine',
|
cluster_name => 'openstack_cluster',
|
||||||
mode => '0755',
|
cluster_members => $cluster_members
|
||||||
owner => 'root',
|
}
|
||||||
group => 'root',
|
|
||||||
} ->
|
class {'pacemaker::stonith':
|
||||||
cs_primitive { 'heat-engine':
|
disable => true
|
||||||
primitive_class => 'ocf',
|
} ->
|
||||||
primitive_type => 'heat-engine',
|
file { '/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central':
|
||||||
provided_by => 'heartbeat',
|
source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central',
|
||||||
operations => {
|
mode => '0755',
|
||||||
'monitor' => {
|
owner => 'root',
|
||||||
interval => '10s',
|
group => 'root',
|
||||||
timeout => '30s'
|
} ->
|
||||||
},
|
pcmk_resource { 'ceilometer-agent-central':
|
||||||
'start' => {
|
primitive_type => 'ocf:heartbeat:ceilometer-agent-central'
|
||||||
interval => '0',
|
} ->
|
||||||
timeout => '30s',
|
file { '/usr/lib/ocf/resource.d/heartbeat/heat-engine':
|
||||||
on-fail => 'restart'
|
source => 'puppet:///modules/cloud/heartbeat/heat-engine',
|
||||||
|
mode => '0755',
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
} ->
|
||||||
|
pcmk_resource { 'heat-engine':
|
||||||
|
primitive_type => 'ocf:heartbeat:heat-engine'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
class { 'corosync':
|
||||||
|
enable_secauth => false,
|
||||||
|
authkey => '/var/lib/puppet/ssl/certs/ca.pem',
|
||||||
|
bind_address => $cluster_ip,
|
||||||
|
multicast_address => $multicast_address
|
||||||
|
}
|
||||||
|
|
||||||
|
corosync::service { 'pacemaker':
|
||||||
|
version => '0',
|
||||||
|
}
|
||||||
|
|
||||||
|
Package['corosync'] ->
|
||||||
|
cs_property {
|
||||||
|
'no-quorum-policy': value => 'ignore';
|
||||||
|
'stonith-enabled': value => 'false';
|
||||||
|
'pe-warn-series-max': value => 1000;
|
||||||
|
'pe-input-series-max': value => 1000;
|
||||||
|
'cluster-recheck-interval': value => '5min';
|
||||||
|
} ->
|
||||||
|
file { '/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central':
|
||||||
|
source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central',
|
||||||
|
mode => '0755',
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
} ->
|
||||||
|
cs_primitive { 'ceilometer-agent-central':
|
||||||
|
primitive_class => 'ocf',
|
||||||
|
primitive_type => 'ceilometer-agent-central',
|
||||||
|
provided_by => 'heartbeat',
|
||||||
|
operations => {
|
||||||
|
'monitor' => {
|
||||||
|
interval => '10s',
|
||||||
|
timeout => '30s'
|
||||||
|
},
|
||||||
|
'start' => {
|
||||||
|
interval => '0',
|
||||||
|
timeout => '30s',
|
||||||
|
on-fail => 'restart'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ->
|
||||||
|
file { '/usr/lib/ocf/resource.d/heartbeat/heat-engine':
|
||||||
|
source => 'puppet:///modules/cloud/heartbeat/heat-engine',
|
||||||
|
mode => '0755',
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
} ->
|
||||||
|
cs_primitive { 'heat-engine':
|
||||||
|
primitive_class => 'ocf',
|
||||||
|
primitive_type => 'heat-engine',
|
||||||
|
provided_by => 'heartbeat',
|
||||||
|
operations => {
|
||||||
|
'monitor' => {
|
||||||
|
interval => '10s',
|
||||||
|
timeout => '30s'
|
||||||
|
},
|
||||||
|
'start' => {
|
||||||
|
interval => '0',
|
||||||
|
timeout => '30s',
|
||||||
|
on-fail => 'restart'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Run OpenStack SPOF service and disable them since they will be managed by Corosync.
|
# Run OpenStack SPOF service and disable them since they will be managed by Corosync.
|
||||||
class { 'cloud::orchestration::engine':
|
class { 'cloud::orchestration::engine':
|
||||||
enabled => false,
|
enabled => false,
|
||||||
|
|||||||
Reference in New Issue
Block a user