aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/profile/pacemaker
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/profile/pacemaker')
-rw-r--r--manifests/profile/pacemaker/glance.pp7
-rw-r--r--manifests/profile/pacemaker/keystone.pp2
-rw-r--r--manifests/profile/pacemaker/loadbalancer.pp99
-rw-r--r--manifests/profile/pacemaker/neutron/dhcp.pp5
-rw-r--r--manifests/profile/pacemaker/neutron/l3.pp5
-rw-r--r--manifests/profile/pacemaker/neutron/metadata.pp5
-rw-r--r--manifests/profile/pacemaker/neutron/ovs.pp6
-rw-r--r--manifests/profile/pacemaker/neutron/server.pp2
-rw-r--r--manifests/profile/pacemaker/rabbitmq.pp67
9 files changed, 171 insertions, 27 deletions
diff --git a/manifests/profile/pacemaker/glance.pp b/manifests/profile/pacemaker/glance.pp
index 4dca67e..10f4f03 100644
--- a/manifests/profile/pacemaker/glance.pp
+++ b/manifests/profile/pacemaker/glance.pp
@@ -75,14 +75,9 @@ class tripleo::profile::pacemaker::glance (
$pacemaker_master = false
}
- class { '::tripleo::profile::base::glance::api':
- manage_service => false,
- enabled => false,
- }
+ include ::tripleo::profile::base::glance::api
class { '::tripleo::profile::base::glance::registry':
sync_db => $pacemaker_master,
- manage_service => false,
- enabled => false,
}
if $step >= 4 {
diff --git a/manifests/profile/pacemaker/keystone.pp b/manifests/profile/pacemaker/keystone.pp
index 712d58d..42c44d4 100644
--- a/manifests/profile/pacemaker/keystone.pp
+++ b/manifests/profile/pacemaker/keystone.pp
@@ -60,8 +60,6 @@ class tripleo::profile::pacemaker::keystone (
class { '::tripleo::profile::base::keystone':
sync_db => $pacemaker_master,
- manage_service => false,
- enabled => false,
bootstrap_master => $pacemaker_master,
manage_roles => $manage_roles,
manage_endpoint => $manage_roles
diff --git a/manifests/profile/pacemaker/loadbalancer.pp b/manifests/profile/pacemaker/loadbalancer.pp
new file mode 100644
index 0000000..926b482
--- /dev/null
+++ b/manifests/profile/pacemaker/loadbalancer.pp
@@ -0,0 +1,99 @@
+# Copyright 2016 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# == Class: tripleo::profile::pacemaker::loadbalancer
+#
+# Loadbalancer Pacemaker HA profile for tripleo
+#
+# === Parameters
+#
+# [*bootstrap_node*]
+# (Optional) The hostname of the node responsible for bootstrapping tasks
+# Defaults to hiera('bootstrap_nodeid')
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+# [*enable_load_balancer*]
+# (Optional) Whether load balancing is enabled for this cluster
+# Defaults to hiera('enable_load_balancer', true)
+#
+class tripleo::profile::pacemaker::loadbalancer (
+ $bootstrap_node = hiera('bootstrap_nodeid'),
+ $step = hiera('step'),
+ $enable_load_balancer = hiera('enable_load_balancer', true)
+) {
+
+ include ::tripleo::profile::base::loadbalancer
+
+ if $::hostname == downcase($bootstrap_node) {
+ $pacemaker_master = true
+ } else {
+ $pacemaker_master = false
+ }
+
+ if $step >= 2 and $pacemaker_master and $enable_load_balancer {
+ # FIXME: we should not have to access tripleo::loadbalancer class
+ # parameters here to configure pacemaker VIPs. The configuration
+ # of pacemaker VIPs could move into puppet-tripleo or we should
+ # make use of less specific hiera parameters here for the settings.
+ pacemaker::resource::service { 'haproxy':
+ clone_params => true,
+ }
+
+ $control_vip = hiera('tripleo::loadbalancer::controller_virtual_ip')
+ tripleo::pacemaker::haproxy_with_vip { 'haproxy_and_control_vip':
+ vip_name => 'control',
+ ip_address => $control_vip,
+ }
+
+ $public_vip = hiera('tripleo::loadbalancer::public_virtual_ip')
+ tripleo::pacemaker::haproxy_with_vip { 'haproxy_and_public_vip':
+ ensure => $public_vip and $public_vip != $control_vip,
+ vip_name => 'public',
+ ip_address => $public_vip,
+ }
+
+ $redis_vip = hiera('redis_vip')
+ tripleo::pacemaker::haproxy_with_vip { 'haproxy_and_redis_vip':
+ ensure => $redis_vip and $redis_vip != $control_vip,
+ vip_name => 'redis',
+ ip_address => $redis_vip,
+ }
+
+ $internal_api_vip = hiera('tripleo::loadbalancer::internal_api_virtual_ip')
+ tripleo::pacemaker::haproxy_with_vip { 'haproxy_and_internal_api_vip':
+ ensure => $internal_api_vip and $internal_api_vip != $control_vip,
+ vip_name => 'internal_api',
+ ip_address => $internal_api_vip,
+ }
+
+ $storage_vip = hiera('tripleo::loadbalancer::storage_virtual_ip')
+ tripleo::pacemaker::haproxy_with_vip { 'haproxy_and_storage_vip':
+ ensure => $storage_vip and $storage_vip != $control_vip,
+ vip_name => 'storage',
+ ip_address => $storage_vip,
+ }
+
+ $storage_mgmt_vip = hiera('tripleo::loadbalancer::storage_mgmt_virtual_ip')
+ tripleo::pacemaker::haproxy_with_vip { 'haproxy_and_storage_mgmt_vip':
+ ensure => $storage_mgmt_vip and $storage_mgmt_vip != $control_vip,
+ vip_name => 'storage_mgmt',
+ ip_address => $storage_mgmt_vip,
+ }
+ }
+
+}
diff --git a/manifests/profile/pacemaker/neutron/dhcp.pp b/manifests/profile/pacemaker/neutron/dhcp.pp
index 841d225..1f3b178 100644
--- a/manifests/profile/pacemaker/neutron/dhcp.pp
+++ b/manifests/profile/pacemaker/neutron/dhcp.pp
@@ -34,11 +34,8 @@ class tripleo::profile::pacemaker::neutron::dhcp (
include ::neutron::params
include ::tripleo::profile::pacemaker::neutron
+ include ::tripleo::profile::base::neutron::dhcp
- class { '::tripleo::profile::base::neutron::dhcp':
- manage_service => false,
- enabled => false,
- }
if $step >= 5 and downcase($::hostname) == $pacemaker_master {
pacemaker::resource::service { $::neutron::params::dhcp_agent_service:
clone_params => 'interleave=true',
diff --git a/manifests/profile/pacemaker/neutron/l3.pp b/manifests/profile/pacemaker/neutron/l3.pp
index a900016..e1699cc 100644
--- a/manifests/profile/pacemaker/neutron/l3.pp
+++ b/manifests/profile/pacemaker/neutron/l3.pp
@@ -34,11 +34,8 @@ class tripleo::profile::pacemaker::neutron::l3 (
include ::neutron::params
include ::tripleo::profile::pacemaker::neutron
+ include ::tripleo::profile::base::neutron::l3
- class { '::tripleo::profile::base::neutron::l3':
- manage_service => false,
- enabled => false,
- }
if $step >= 5 and downcase($::hostname) == $pacemaker_master {
pacemaker::resource::service { $::neutron::params::l3_agent_service:
clone_params => 'interleave=true',
diff --git a/manifests/profile/pacemaker/neutron/metadata.pp b/manifests/profile/pacemaker/neutron/metadata.pp
index 4030bb2..e6bccb1 100644
--- a/manifests/profile/pacemaker/neutron/metadata.pp
+++ b/manifests/profile/pacemaker/neutron/metadata.pp
@@ -34,11 +34,8 @@ class tripleo::profile::pacemaker::neutron::metadata (
include ::neutron::params
include ::tripleo::profile::pacemaker::neutron
+ include ::tripleo::profile::base::neutron::metadata
- class { '::tripleo::profile::base::neutron::metadata':
- manage_service => false,
- enabled => false,
- }
if $step >= 5 and downcase($::hostname) == $pacemaker_master {
pacemaker::resource::service { $::neutron::params::metadata_agent_service:
clone_params => 'interleave=true',
diff --git a/manifests/profile/pacemaker/neutron/ovs.pp b/manifests/profile/pacemaker/neutron/ovs.pp
index c3ce36e..34ff5d3 100644
--- a/manifests/profile/pacemaker/neutron/ovs.pp
+++ b/manifests/profile/pacemaker/neutron/ovs.pp
@@ -34,11 +34,7 @@ class tripleo::profile::pacemaker::neutron::ovs (
include ::neutron::params
include ::tripleo::profile::pacemaker::neutron
-
- class { '::tripleo::profile::base::neutron::ovs':
- manage_service => false,
- enabled => false,
- }
+ include ::tripleo::profile::base::neutron::ovs
if $step >= 5 and downcase($::hostname) == $pacemaker_master {
diff --git a/manifests/profile/pacemaker/neutron/server.pp b/manifests/profile/pacemaker/neutron/server.pp
index 4ff2e88..83e8a2a 100644
--- a/manifests/profile/pacemaker/neutron/server.pp
+++ b/manifests/profile/pacemaker/neutron/server.pp
@@ -38,8 +38,6 @@ class tripleo::profile::pacemaker::neutron::server (
class { '::tripleo::profile::base::neutron::server':
sync_db => ($::hostname == downcase($pacemaker_master)),
- manage_service => false,
- enabled => false,
}
if ($::hostname == downcase($pacemaker_master)) {
diff --git a/manifests/profile/pacemaker/rabbitmq.pp b/manifests/profile/pacemaker/rabbitmq.pp
new file mode 100644
index 0000000..efb91b5
--- /dev/null
+++ b/manifests/profile/pacemaker/rabbitmq.pp
@@ -0,0 +1,67 @@
+# Copyright 2016 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# == Class: tripleo::profile::pacemaker::rabbitmq
+#
+# RabbitMQ Pacemaker HA profile for tripleo
+#
+# === Parameters
+#
+# [*bootstrap_node*]
+# (Optional) The hostname of the node responsible for bootstrapping tasks
+# Defaults to hiera('bootstrap_nodeid')
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+# [*erlang_cookie*]
+# (Optional) Content of erlang cookie.
+# Defaults to hiera('rabbitmq::erlang_cookie').
+#
+class tripleo::profile::pacemaker::rabbitmq (
+ $bootstrap_node = hiera('bootstrap_nodeid'),
+ $step = hiera('step'),
+ $erlang_cookie = hiera('rabbitmq::erlang_cookie'),
+) {
+
+ if $::hostname == downcase($bootstrap_node) {
+ $pacemaker_master = true
+ } else {
+ $pacemaker_master = false
+ }
+
+ include ::tripleo::profile::base::rabbitmq
+
+ file { '/var/lib/rabbitmq/.erlang.cookie':
+ ensure => file,
+ owner => 'rabbitmq',
+ group => 'rabbitmq',
+ mode => '0400',
+ content => $erlang_cookie,
+ replace => true,
+ require => Class['::rabbitmq'],
+ }
+
+ if $step >= 2 and $pacemaker_master {
+ pacemaker::resource::ocf { 'rabbitmq':
+ ocf_agent_name => 'heartbeat:rabbitmq-cluster',
+ resource_params => 'set_policy=\'ha-all ^(?!amq\.).* {"ha-mode":"all"}\'',
+ clone_params => 'ordered=true interleave=true',
+ meta_params => 'notify=true',
+ require => Class['::rabbitmq'],
+ }
+ }
+}