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',
|
||||
:git => 'git://github.com/enovance/puppetlabs-ntp.git',
|
||||
:ref => 'eb02ba2937ce86fb609ae41499767244b78ec58d'
|
||||
mod 'pacemaker',
|
||||
:git => 'git://github.com/enovance/puppet-pacemaker.git',
|
||||
:ref => '1102d9861d8a63cc1577bc97a4415b9ff7488038'
|
||||
mod 'rabbitmq',
|
||||
:git => 'git://github.com/enovance/puppetlabs-rabbitmq.git',
|
||||
:ref => '25420cb3c26c9a8432ab519d43c094d614d4fec4'
|
||||
|
@@ -23,6 +23,11 @@
|
||||
# (optional) Interface used by Corosync to send multicast traffic
|
||||
# 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*]
|
||||
# (optionnal) IP address used to send multicast traffic
|
||||
# Defaults to '239.1.1.2'
|
||||
@@ -30,73 +35,109 @@
|
||||
|
||||
class cloud::spof(
|
||||
$cluster_ip = '127.0.0.1',
|
||||
$cluster_members = false,
|
||||
$multicast_address = '239.1.1.2'
|
||||
) {
|
||||
|
||||
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'
|
||||
}
|
||||
if $::operatingsystem == 'RedHat' {
|
||||
if ! $cluster_members {
|
||||
fail('cluster_members is a required parameter.')
|
||||
}
|
||||
} ->
|
||||
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'
|
||||
|
||||
class { 'pacemaker::corosync':
|
||||
cluster_name => 'openstack_cluster',
|
||||
cluster_members => $cluster_members
|
||||
}
|
||||
|
||||
class {'pacemaker::stonith':
|
||||
disable => true
|
||||
} ->
|
||||
file { '/usr/lib/ocf/resource.d/heartbeat/ceilometer-agent-central':
|
||||
source => 'puppet:///modules/cloud/heartbeat/ceilometer-agent-central',
|
||||
mode => '0755',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
} ->
|
||||
pcmk_resource { 'ceilometer-agent-central':
|
||||
primitive_type => 'ocf:heartbeat:ceilometer-agent-central'
|
||||
} ->
|
||||
file { '/usr/lib/ocf/resource.d/heartbeat/heat-engine':
|
||||
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.
|
||||
class { 'cloud::orchestration::engine':
|
||||
enabled => false,
|
||||
|
Reference in New Issue
Block a user