aboutsummaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/certmonger.pp37
-rw-r--r--manifests/certmonger/haproxy.pp75
-rw-r--r--manifests/haproxy.pp40
-rw-r--r--manifests/profile/base/ceilometer.pp10
-rw-r--r--manifests/profile/base/ceilometer/collector.pp38
-rw-r--r--manifests/profile/base/database/mysql.pp85
-rw-r--r--manifests/profile/base/horizon.pp50
-rw-r--r--manifests/profile/base/mistral.pp39
-rw-r--r--manifests/profile/base/mistral/api.pp36
-rw-r--r--manifests/profile/base/mistral/engine.pp46
-rw-r--r--manifests/profile/base/mistral/executor.pp36
-rw-r--r--manifests/profile/base/neutron.pp7
-rw-r--r--manifests/profile/base/neutron/agents/midonet.pp56
-rw-r--r--manifests/profile/base/neutron/agents/nuage.pp62
-rw-r--r--manifests/profile/base/neutron/dhcp.pp13
-rw-r--r--manifests/profile/base/neutron/midonet.pp9
-rw-r--r--manifests/profile/base/nova/compute.pp11
-rw-r--r--manifests/profile/base/pacemaker.pp93
-rw-r--r--manifests/profile/base/sahara/api.pp2
-rw-r--r--manifests/profile/base/sahara/engine.pp2
-rw-r--r--manifests/profile/pacemaker/ceilometer.pp39
-rw-r--r--manifests/profile/pacemaker/ceilometer/api.pp7
-rw-r--r--manifests/profile/pacemaker/database/mysql.pp184
-rw-r--r--manifests/profile/pacemaker/gnocchi.pp16
-rw-r--r--manifests/profile/pacemaker/neutron.pp4
-rw-r--r--manifests/profile/pacemaker/sahara.pp34
-rw-r--r--manifests/profile/pacemaker/sahara/api.pp50
-rw-r--r--manifests/profile/pacemaker/sahara/engine.pp51
28 files changed, 1004 insertions, 128 deletions
diff --git a/manifests/certmonger.pp b/manifests/certmonger.pp
new file mode 100644
index 0000000..e5f5e04
--- /dev/null
+++ b/manifests/certmonger.pp
@@ -0,0 +1,37 @@
+# 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::certmonger
+#
+# Sets some default defaults necessary for the global certmonger setup.
+#
+# === Parameters
+#
+# [*global_ca*]
+# The certmonger nickname for the CA that will be used.
+#
+class tripleo::certmonger (
+ $global_ca
+){
+ include ::certmonger
+
+ Certmonger_certificate {
+ ca => $global_ca,
+ ensure => 'present',
+ certbackend => 'FILE',
+ keybackend => 'FILE',
+ wait => true,
+ require => Class['::certmonger'],
+ }
+}
diff --git a/manifests/certmonger/haproxy.pp b/manifests/certmonger/haproxy.pp
new file mode 100644
index 0000000..2b738e6
--- /dev/null
+++ b/manifests/certmonger/haproxy.pp
@@ -0,0 +1,75 @@
+# 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.
+#
+# == Resource: tripleo::certmonger::haproxy
+#
+# Request a certificate for the HAProxy service and does the necessary logic to
+# get it into a format that the service understands.
+#
+# === Parameters
+#
+# [*service_pem*]
+# The file in PEM format that the HAProxy service will use as a certificate.
+#
+# [*service_certificate*]
+# The certificate file that certmonger will be tracking.
+#
+# [*service_key*]
+# The key file that certmonger will use for the certificate.
+#
+# [*hostname*]
+# The hostname that certmonger will use as the common name for the
+# certificate.
+#
+# [*postsave_cmd*]
+# The post-save-command that certmonger will use once it renews the
+# certificate.
+#
+# [*principal*]
+# The haproxy service principal that is set for HAProxy in kerberos.
+#
+define tripleo::certmonger::haproxy (
+ $service_pem,
+ $service_certificate,
+ $service_key,
+ $hostname,
+ $postsave_cmd,
+ $principal = undef,
+){
+ certmonger_certificate { "${title}-cert":
+ hostname => $hostname,
+ certfile => $service_certificate,
+ keyfile => $service_key,
+ postsave_cmd => $postsave_cmd,
+ principal => $principal,
+ }
+ concat { $service_pem :
+ ensure => present,
+ mode => '0640',
+ owner => 'haproxy',
+ group => 'haproxy',
+ }
+ concat::fragment { "${title}-cert-fragment":
+ target => $service_pem,
+ source => $service_certificate,
+ order => '01',
+ require => Certmonger_certificate["${title}-cert"],
+ }
+ concat::fragment { "${title}-key-fragment":
+ target => $service_pem,
+ source => $service_key,
+ order => 10,
+ require => Certmonger_certificate["${title}-cert"],
+ }
+}
diff --git a/manifests/haproxy.pp b/manifests/haproxy.pp
index e3e48ce..407fbb7 100644
--- a/manifests/haproxy.pp
+++ b/manifests/haproxy.pp
@@ -169,6 +169,10 @@
# (optional) Enable or not Gnocchi API binding
# Defaults to false
#
+# [*mistral*]
+# (optional) Enable or not Mistral API binding
+# Defaults to false
+#
# [*swift_proxy_server*]
# (optional) Enable or not Swift API binding
# Defaults to false
@@ -193,6 +197,10 @@
# (optional) Enable or not Ironic API binding
# Defaults to false
#
+# [*ironic_inspector*]
+# (optional) Enable or not Ironic Inspector API binding
+# Defaults to false
+#
# [*mysql*]
# (optional) Enable or not MySQL Galera binding
# Defaults to false
@@ -232,6 +240,8 @@
# 'glance_registry_port' (Defaults to 9191)
# 'gnocchi_api_port' (Defaults to 8041)
# 'gnocchi_api_ssl_port' (Defaults to 13041)
+# 'mistral_api_port' (Defaults to 8989)
+# 'mistral_api_ssl_port' (Defaults to 13989)
# 'heat_api_port' (Defaults to 8004)
# 'heat_api_ssl_port' (Defaults to 13004)
# 'heat_cfn_port' (Defaults to 8000)
@@ -240,6 +250,8 @@
# 'heat_cw_ssl_port' (Defaults to 13003)
# 'ironic_api_port' (Defaults to 6385)
# 'ironic_api_ssl_port' (Defaults to 13385)
+# 'ironic_inspector_port' (Defaults to 5050)
+# 'ironic_inspector_ssl_port' (Defaults to 13050)
# 'keystone_admin_api_port' (Defaults to 35357)
# 'keystone_admin_api_ssl_port' (Defaults to 13357)
# 'keystone_public_api_port' (Defaults to 5000)
@@ -296,12 +308,14 @@ class tripleo::haproxy (
$ceilometer = false,
$aodh = false,
$gnocchi = false,
+ $mistral = false,
$swift_proxy_server = false,
$heat_api = false,
$heat_cloudwatch = false,
$heat_cfn = false,
$horizon = false,
$ironic = false,
+ $ironic_inspector = false,
$mysql = false,
$mysql_clustercheck = false,
$rabbitmq = false,
@@ -322,6 +336,8 @@ class tripleo::haproxy (
glance_registry_port => 9191,
gnocchi_api_port => 8041,
gnocchi_api_ssl_port => 13041,
+ mistral_api_port => 8989,
+ mistral_api_ssl_port => 13989,
heat_api_port => 8004,
heat_api_ssl_port => 13004,
heat_cfn_port => 8000,
@@ -330,6 +346,8 @@ class tripleo::haproxy (
heat_cw_ssl_port => 13003,
ironic_api_port => 6385,
ironic_api_ssl_port => 13385,
+ ironic_inspector_port => 5050,
+ ironic_inspector_ssl_port => 13050,
keystone_admin_api_port => 35357,
keystone_admin_api_ssl_port => 13357,
keystone_public_api_port => 5000,
@@ -662,6 +680,17 @@ class tripleo::haproxy (
}
}
+ if $mistral {
+ ::tripleo::haproxy::endpoint { 'mistral':
+ public_virtual_ip => $public_virtual_ip,
+ internal_ip => hiera('mistral_api_vip', $controller_virtual_ip),
+ service_port => $ports[mistral_api_port],
+ ip_addresses => hiera('mistral_api_node_ips', $controller_hosts_real),
+ server_names => $controller_hosts_names_real,
+ public_ssl_port => $ports[mistral_api_ssl_port],
+ }
+ }
+
if $swift_proxy_server {
::tripleo::haproxy::endpoint { 'swift_proxy_server':
public_virtual_ip => $public_virtual_ip,
@@ -754,6 +783,17 @@ class tripleo::haproxy (
}
}
+ if $ironic_inspector {
+ ::tripleo::haproxy::endpoint { 'ironic-inspector':
+ public_virtual_ip => $public_virtual_ip,
+ internal_ip => hiera('ironic_inspector_vip', $controller_virtual_ip),
+ service_port => $ports[ironic_inspector_port],
+ ip_addresses => hiera('ironic_inspector_node_ips', $controller_hosts_real),
+ server_names => $controller_hosts_names_real,
+ public_ssl_port => $ports[ironic_inspector_ssl_port],
+ }
+ }
+
if $mysql_clustercheck {
$mysql_listen_options = {
'option' => [ 'tcpka', 'httpchk' ],
diff --git a/manifests/profile/base/ceilometer.pp b/manifests/profile/base/ceilometer.pp
index 97e1bb8..88818de 100644
--- a/manifests/profile/base/ceilometer.pp
+++ b/manifests/profile/base/ceilometer.pp
@@ -23,18 +23,12 @@
# for more details.
# Defaults to hiera('step')
#
-# [*sync_db*]
-# (Optional) Whether to run db sync
-# Defaults to true
-#
class tripleo::profile::base::ceilometer (
- $step = hiera('step'),
- $sync_db = true,
+ $step = hiera('step'),
) {
- if $step >= 4 or ($step >= 3 and $sync_db) {
+ if $step >= 3 {
include ::ceilometer
- include ::ceilometer::db
include ::ceilometer::config
}
diff --git a/manifests/profile/base/ceilometer/collector.pp b/manifests/profile/base/ceilometer/collector.pp
index 34ee90b..c294e56 100644
--- a/manifests/profile/base/ceilometer/collector.pp
+++ b/manifests/profile/base/ceilometer/collector.pp
@@ -33,16 +33,44 @@ class tripleo::profile::base::ceilometer::collector (
$sync_db = true,
) {
+ $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb'))
+ # MongoDB
+ if $ceilometer_backend == 'mongodb' {
+ # NOTE(gfidente): We need to pass the list of IPv6 addresses *with* port and
+ # without the brackets as 'members' argument for the 'mongodb_replset'
+ # resource.
+ if str2bool(hiera('mongodb::server::ipv6', false)) {
+ $mongo_node_ips_with_port_prefixed = prefix(hiera('mongo_node_ips'), '[')
+ $mongo_node_ips_with_port = suffix($mongo_node_ips_with_port_prefixed, ']:27017')
+ $mongo_node_ips_with_port_nobr = suffix(hiera('mongo_node_ips'), ':27017')
+ } else {
+ $mongo_node_ips_with_port = suffix(hiera('mongo_node_ips'), ':27017')
+ $mongo_node_ips_with_port_nobr = suffix(hiera('mongo_node_ips'), ':27017')
+ }
+ $mongo_node_string = join($mongo_node_ips_with_port, ',')
+
+ $mongodb_replset = hiera('mongodb::server::replset')
+ $ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
+ }
+
include ::tripleo::profile::base::ceilometer
+ if $step >= 2 and $sync_db and $ceilometer_backend == 'mysql' {
+ include ::ceilometer::db::mysql
+ }
+
if $step >= 3 and $sync_db {
- $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb'))
- if $ceilometer_backend == 'mysql' {
- include ::ceilometer::db::mysql
- }
+ include ::ceilometer::db::sync
}
- if $step >= 4 {
+ if $step >= 4 or ($step >= 3 and $sync_db) {
+ if $ceilometer_backend == 'mongodb' {
+ class { '::ceilometer::db' :
+ database_connection => $ceilometer_mongodb_conn_string,
+ }
+ } else {
+ include ::ceilometer::db
+ }
include ::ceilometer::collector
include ::ceilometer::dispatcher::gnocchi
}
diff --git a/manifests/profile/base/database/mysql.pp b/manifests/profile/base/database/mysql.pp
new file mode 100644
index 0000000..9552e10
--- /dev/null
+++ b/manifests/profile/base/database/mysql.pp
@@ -0,0 +1,85 @@
+# 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::base::database::mysql
+#
+# MySQL profile for tripleo
+#
+# === Parameters
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+# [*mysql_server_options*]
+# (Optional) Extras options to deploy MySQL. Useful when deploying Galera cluster.
+# Should be an hash.
+# Defaults to {}
+#
+# [*manage_resources*]
+# (Optional) Whether or not manage root user, root my.cnf, and service.
+# Defaults to true
+#
+# [*remove_default_accounts*]
+# (Optional) Whether or not remove default MySQL accounts.
+# Defaults to true
+#
+class tripleo::profile::base::database::mysql (
+ $step = hiera('step'),
+ $mysql_server_options = {},
+ $manage_resources = true,
+ $remove_default_accounts = true,
+) {
+
+ validate_hash($mysql_server_options)
+
+ # non-ha scenario
+ if $manage_resources {
+ $mysql_step = 2
+ } else {
+ # ha scenario
+ $mysql_step = 1
+ }
+ if hiera('step') >= $mysql_step {
+ if str2bool(hiera('enable_galera', true)) {
+ $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
+ } else {
+ $mysql_config_file = '/etc/my.cnf.d/server.cnf'
+ }
+ # TODO Galara
+ # FIXME: due to https://bugzilla.redhat.com/show_bug.cgi?id=1298671 we
+ # set bind-address to a hostname instead of an ip address; to move Mysql
+ # from internal_api on another network we'll have to customize both
+ # MysqlNetwork and ControllerHostnameResolveNetwork in ServiceNetMap
+ $mysql_server_default = {
+ 'mysqld' => {
+ 'bind-address' => $::hostname,
+ 'max_connections' => hiera('mysql_max_connections'),
+ 'open_files_limit' => '-1',
+ }
+ }
+ $mysql_server_options_real = deep_merge($mysql_server_default, $mysql_server_options)
+ class { '::mysql::server':
+ config_file => $mysql_config_file,
+ override_options => $mysql_server_options_real,
+ create_root_user => $manage_resources,
+ create_root_my_cnf => $manage_resources,
+ service_manage => $manage_resources,
+ service_enabled => $manage_resources,
+ remove_default_accounts => $remove_default_accounts,
+ }
+ }
+
+}
diff --git a/manifests/profile/base/horizon.pp b/manifests/profile/base/horizon.pp
new file mode 100644
index 0000000..1b7df19
--- /dev/null
+++ b/manifests/profile/base/horizon.pp
@@ -0,0 +1,50 @@
+# 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::base::horizon
+#
+# Horizon profile for tripleo
+#
+# === Parameters
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::horizon (
+ $step = hiera('step'),
+) {
+ if $step >= 4 {
+ # Horizon
+ include ::apache::mod::remoteip
+ include ::apache::mod::status
+ if 'cisco_n1kv' in hiera('neutron::plugins::ml2::mechanism_drivers') {
+ $_profile_support = 'cisco'
+ } else {
+ $_profile_support = 'None'
+ }
+ $neutron_options = {'profile_support' => $_profile_support }
+ $memcached_ipv6 = hiera('memcached_ipv6', false)
+ if $memcached_ipv6 {
+ $horizon_memcached_servers = hiera('memcache_node_ips_v6', '[::1]')
+ } else {
+ $horizon_memcached_servers = hiera('memcache_node_ips', '127.0.0.1')
+ }
+ class { '::horizon':
+ cache_server_ip => $horizon_memcached_servers,
+ neutron_options => $neutron_options,
+ }
+ }
+}
diff --git a/manifests/profile/base/mistral.pp b/manifests/profile/base/mistral.pp
new file mode 100644
index 0000000..42507b9
--- /dev/null
+++ b/manifests/profile/base/mistral.pp
@@ -0,0 +1,39 @@
+# 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::base::mistral
+#
+# Mistral profile for tripleo
+#
+# === Parameters
+#
+# [*sync_db*]
+# (Optional) Whether to run db sync
+# Defaults to true
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::mistral (
+ $sync_db = true,
+ $step = hiera('step'),
+) {
+
+ if $step >= 3 {
+ include ::mistral
+ include ::mistral::config
+ }
+}
diff --git a/manifests/profile/base/mistral/api.pp b/manifests/profile/base/mistral/api.pp
new file mode 100644
index 0000000..b955c8d
--- /dev/null
+++ b/manifests/profile/base/mistral/api.pp
@@ -0,0 +1,36 @@
+# 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::base::mistral::api
+#
+# Mistral API profile for tripleo
+#
+# === Parameters
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::mistral::api (
+ $step = hiera('step'),
+) {
+
+ include ::tripleo::profile::base::mistral
+
+ if $step >= 4 {
+ include ::mistral::api
+ }
+}
+
diff --git a/manifests/profile/base/mistral/engine.pp b/manifests/profile/base/mistral/engine.pp
new file mode 100644
index 0000000..141cbad
--- /dev/null
+++ b/manifests/profile/base/mistral/engine.pp
@@ -0,0 +1,46 @@
+# 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::base::mistral::engine
+#
+# Mistral Engine profile for tripleo
+#
+# === Parameters
+#
+# [*sync_db*]
+# (Optional) Whether to run db sync
+# Defaults to undef
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::mistral::engine (
+ $sync_db = true,
+ $step = hiera('step'),
+) {
+
+ include ::tripleo::profile::base::mistral
+
+ if $step >= 3 and $sync_db {
+ include ::mistral::db::mysql
+ include ::mistral::db::sync
+ }
+
+ if $step >= 4 {
+ include ::mistral::engine
+ }
+
+}
diff --git a/manifests/profile/base/mistral/executor.pp b/manifests/profile/base/mistral/executor.pp
new file mode 100644
index 0000000..d7b5776
--- /dev/null
+++ b/manifests/profile/base/mistral/executor.pp
@@ -0,0 +1,36 @@
+# 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::base::mistral::executor
+#
+# Mistral Executor profile for tripleo
+#
+# === Parameters
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::mistral::executor (
+ $step = hiera('step'),
+) {
+
+ include ::tripleo::profile::base::mistral
+
+ if $step >= 4 {
+ include ::mistral::executor
+ }
+
+}
diff --git a/manifests/profile/base/neutron.pp b/manifests/profile/base/neutron.pp
index d5efa81..1ee2d90 100644
--- a/manifests/profile/base/neutron.pp
+++ b/manifests/profile/base/neutron.pp
@@ -18,19 +18,14 @@
#
# === Parameters
#
-# [*sync_db*]
-# (Optional) Whether to run db sync
-# Defaults to true
-#
# [*step*]
# (Optional) The current step of the deployment
# Defaults to hiera('step')
#
class tripleo::profile::base::neutron (
- $sync_db = true,
$step = hiera('step'),
) {
- if hiera('step') >= 4 or ( hiera('step') >= 3 and $sync_db ) {
+ if hiera('step') >= 3 {
include ::neutron
include ::neutron::config
}
diff --git a/manifests/profile/base/neutron/agents/midonet.pp b/manifests/profile/base/neutron/agents/midonet.pp
new file mode 100644
index 0000000..52cafa9
--- /dev/null
+++ b/manifests/profile/base/neutron/agents/midonet.pp
@@ -0,0 +1,56 @@
+# 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::base::neutron::agents::midonet
+#
+# Midonet Neutron agent profile
+#
+# === Parameters
+#
+# [*neutron_api_node_ips*]
+# (Optional) The IPs of the Neutron API hosts
+# Defaults to hiera('neutron_api_node_ips')
+#
+# [*midonet_libvirt_qemu_data*]
+# (Optional) qemu.conf data for midonet.
+# Defaults to hiera('midonet_libvirt_qemu_data')
+#
+# [*step*]
+# (Optional) The current step of the deployment
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::neutron::agents::midonet (
+ $neutron_api_node_ips = hiera('neutron_api_node_ips', ''),
+ $midonet_libvirt_qemu_data = hiera('midonet_libvirt_qemu_data', ''),
+ $step = hiera('step'),
+) {
+
+ if $step >= 4 {
+
+ # TODO(devvesa) provide non-controller ips for these services
+ class { '::tripleo::network::midonet::agent':
+ zookeeper_servers => $neutron_api_node_ips,
+ cassandra_seeds => $neutron_api_node_ips
+ }
+
+ if defined(Service['libvirt']) {
+ file { '/etc/libvirt/qemu.conf':
+ ensure => present,
+ content => hiera('midonet_libvirt_qemu_data')
+ }
+ }
+
+ }
+
+}
diff --git a/manifests/profile/base/neutron/agents/nuage.pp b/manifests/profile/base/neutron/agents/nuage.pp
new file mode 100644
index 0000000..c50feb2
--- /dev/null
+++ b/manifests/profile/base/neutron/agents/nuage.pp
@@ -0,0 +1,62 @@
+# 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::base::neutron::agents::nuage
+#
+# Nuage Neutron agent profile
+#
+# === Parameters
+#
+# [*nova_os_tenant_name*]
+# (Optional) Nova tenant name
+# Defaults to hiera('nova_os_tenant_name')
+#
+# [*nova_os_password*]
+# (Optional) Nova password
+# Defaults to hiera('nova_password')
+#
+# [*nova_metadata_ip*]
+# (Optional) Nova metadata node IPs
+# Defaults to hiera('nova_metadata_node_ips')
+#
+# [*nova_auth_ip*]
+# (Optional) Nova auth IP
+# Defaults to hiera('keystone_public_api_virtual_ip')
+#
+# [*step*]
+# (Optional) The current step of the deployment
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::neutron::agents::nuage (
+ $nova_os_tenant_name = hiera('nova::api::admin_tenant_name', ''),
+ $nova_os_password = hiera('nova_password', ''),
+ $nova_metadata_ip = hiera('nova_metadata_node_ips', ''),
+ $nova_auth_ip = hiera('keystone_public_api_virtual_ip', ''),
+ $step = hiera('step'),
+) {
+
+ if $step >= 4 {
+
+ include ::nuage::vrs
+
+ class { '::nuage::metadataagent':
+ nova_os_tenant_name => $nova_os_tenant_name,
+ nova_os_password => $nova_os_password,
+ nova_metadata_ip => $nova_metadata_ip,
+ nova_auth_ip => $nova_auth_ip,
+ }
+
+ }
+
+}
diff --git a/manifests/profile/base/neutron/dhcp.pp b/manifests/profile/base/neutron/dhcp.pp
index 180fd37..a313478 100644
--- a/manifests/profile/base/neutron/dhcp.pp
+++ b/manifests/profile/base/neutron/dhcp.pp
@@ -18,31 +18,18 @@
#
# === Parameters
#
-# [*neutron_dnsmasq_options*]
-# (Optional)
-# Defaults to hiera('neutron_dnsmasq_options')
-#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
class tripleo::profile::base::neutron::dhcp (
- $neutron_dnsmasq_options = hiera('neutron_dnsmasq_options', ''),
$step = hiera('step'),
) {
if $step >= 4 {
include ::tripleo::profile::base::neutron
include ::neutron::agents::dhcp
- file { '/etc/neutron/dnsmasq-neutron.conf':
- content => $neutron_dnsmasq_options,
- owner => 'neutron',
- group => 'neutron',
- notify => Service['neutron-dhcp-service'],
- require => Package['neutron'],
- }
-
Service<| title == 'neutron-server' |> -> Service <| title == 'neutron-dhcp' |>
}
}
diff --git a/manifests/profile/base/neutron/midonet.pp b/manifests/profile/base/neutron/midonet.pp
index 972856f..3276b82 100644
--- a/manifests/profile/base/neutron/midonet.pp
+++ b/manifests/profile/base/neutron/midonet.pp
@@ -82,11 +82,9 @@ class tripleo::profile::base::neutron::midonet (
) {
include ::tripleo::profile::base::neutron
+ include ::tripleo::profile::base::neutron::agents::midonet
if $step >= 4 {
- class { '::neutron':
- service_plugins => []
- }
# Run zookeeper in the controller if configured
if zk_on_controller {
@@ -106,11 +104,6 @@ class tripleo::profile::base::neutron::midonet (
}
}
- class {'::tripleo::network::midonet::agent':
- zookeeper_servers => $neutron_api_node_ips,
- cassandra_seeds => $neutron_api_node_ips
- }
-
class {'::tripleo::network::midonet::api':
zookeeper_servers => $neutron_api_node_ips,
vip => $vip,
diff --git a/manifests/profile/base/nova/compute.pp b/manifests/profile/base/nova/compute.pp
index c73d2b1..076996a 100644
--- a/manifests/profile/base/nova/compute.pp
+++ b/manifests/profile/base/nova/compute.pp
@@ -44,6 +44,17 @@ class tripleo::profile::base::nova::compute (
# deploy bits to connect nova compute to neutron
include ::nova::network::neutron
+
+ # When utilising images for deployment, we need to reset the iSCSI initiator name to make it unique
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1244328
+ exec { 'reset-iscsi-initiator-name':
+ command => '/bin/echo InitiatorName=$(/usr/sbin/iscsi-iname) > /etc/iscsi/initiatorname.iscsi',
+ onlyif => '/usr/bin/test ! -f /etc/iscsi/.initiator_reset',
+ before => File['/etc/iscsi/.initiator_reset'],
+ }
+ file { '/etc/iscsi/.initiator_reset':
+ ensure => present,
+ }
}
# If NFS is used as a Cinder backend
diff --git a/manifests/profile/base/pacemaker.pp b/manifests/profile/base/pacemaker.pp
new file mode 100644
index 0000000..de107a9
--- /dev/null
+++ b/manifests/profile/base/pacemaker.pp
@@ -0,0 +1,93 @@
+# 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::base::pacemaker
+#
+# Pacemaker profile for tripleo
+#
+# === Parameters
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::pacemaker (
+ $step = hiera('step'),
+) {
+
+ Pcmk_resource <| |> {
+ tries => 10,
+ try_sleep => 3,
+ }
+
+ if $::hostname == downcase(hiera('bootstrap_nodeid')) {
+ $pacemaker_master = true
+ } else {
+ $pacemaker_master = false
+ }
+
+ $enable_fencing = str2bool(hiera('enable_fencing', false)) and hiera('step') >= 5
+
+ if hiera('step') >= 1 {
+ $pacemaker_cluster_members = downcase(regsubst(hiera('controller_node_names'), ',', ' ', 'G'))
+ $corosync_ipv6 = str2bool(hiera('corosync_ipv6', false))
+ if $corosync_ipv6 {
+ $cluster_setup_extras = { '--token' => hiera('corosync_token_timeout', 1000), '--ipv6' => '' }
+ } else {
+ $cluster_setup_extras = { '--token' => hiera('corosync_token_timeout', 1000) }
+ }
+ class { '::pacemaker':
+ hacluster_pwd => hiera('hacluster_pwd'),
+ } ->
+ class { '::pacemaker::corosync':
+ cluster_members => $pacemaker_cluster_members,
+ setup_cluster => $pacemaker_master,
+ cluster_setup_extras => $cluster_setup_extras,
+ }
+ class { '::pacemaker::stonith':
+ disable => !$enable_fencing,
+ }
+ if $enable_fencing {
+ include ::tripleo::fencing
+
+ # enable stonith after all Pacemaker resources have been created
+ Pcmk_resource<||> -> Class['tripleo::fencing']
+ Pcmk_constraint<||> -> Class['tripleo::fencing']
+ Exec <| tag == 'pacemaker_constraint' |> -> Class['tripleo::fencing']
+ # enable stonith after all fencing devices have been created
+ Class['tripleo::fencing'] -> Class['pacemaker::stonith']
+ }
+
+ # FIXME(gfidente): sets 200secs as default start timeout op
+ # param; until we can use pcmk global defaults we'll still
+ # need to add it to every resource which redefines op params
+ Pacemaker::Resource::Service {
+ op_params => 'start timeout=200s stop timeout=200s',
+ }
+ }
+
+ if hiera('step') >= 2 {
+ if $pacemaker_master {
+ include ::pacemaker::resource_defaults
+
+ # Create an openstack-core dummy resource. See RHBZ 1290121
+ pacemaker::resource::ocf { 'openstack-core':
+ ocf_agent_name => 'heartbeat:Dummy',
+ clone_params => 'interleave=true',
+ }
+ }
+ }
+
+}
diff --git a/manifests/profile/base/sahara/api.pp b/manifests/profile/base/sahara/api.pp
index e9149b1..dc23d64 100644
--- a/manifests/profile/base/sahara/api.pp
+++ b/manifests/profile/base/sahara/api.pp
@@ -28,6 +28,6 @@ class tripleo::profile::base::sahara::api (
) {
if $step >= 4 {
include ::tripleo::profile::base::sahara
- include ::sahara::api
+ include ::sahara::service::api
}
}
diff --git a/manifests/profile/base/sahara/engine.pp b/manifests/profile/base/sahara/engine.pp
index 28aff7b..8fa1f5f 100644
--- a/manifests/profile/base/sahara/engine.pp
+++ b/manifests/profile/base/sahara/engine.pp
@@ -37,6 +37,6 @@ class tripleo::profile::base::sahara::engine (
if $step >= 4 or ($step >= 3 and $sync_db) {
include ::tripleo::profile::base::sahara
- include ::sahara::engine
+ include ::sahara::service::engine
}
}
diff --git a/manifests/profile/pacemaker/ceilometer.pp b/manifests/profile/pacemaker/ceilometer.pp
index 0c21807..23021fc 100644
--- a/manifests/profile/pacemaker/ceilometer.pp
+++ b/manifests/profile/pacemaker/ceilometer.pp
@@ -27,47 +27,18 @@
# for more details.
# Defaults to hiera('step')
#
-# [*sync_db*]
-# (Optional) Whether to run db sync
-# Defaults to undef
-#
class tripleo::profile::pacemaker::ceilometer (
$bootstrap_node = hiera('bootstrap_nodeid'),
$step = hiera('step'),
- $sync_db = true,
) {
- if $::hostname == downcase($bootstrap_node) {
- $pacemaker_master = true
- } else {
- $pacemaker_master = false
- }
-
include ::tripleo::profile::base::ceilometer
- if $step >= 5 and $pacemaker_master {
- $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb'))
- case $ceilometer_backend {
- /mysql/: {
- pacemaker::resource::service { $::ceilometer::params::agent_central_service_name:
- clone_params => 'interleave=true',
- require => Pacemaker::Resource::Ocf['openstack-core'],
- }
- }
- default: {
- pacemaker::resource::service { $::ceilometer::params::agent_central_service_name:
- clone_params => 'interleave=true',
- require => [Pacemaker::Resource::Ocf['openstack-core'],
- Pacemaker::Resource::Service[$::mongodb::params::service_name]],
- }
- }
- }
-
- if $sync_db {
- if $ceilometer_backend == 'mysql' {
- class { '::ceilometer::db::mysql':
- require => Exec['galera-ready'],
- }
+ $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb'))
+ if $step >= 5 and $::hostname == downcase($bootstrap_node) {
+ if $ceilometer_backend == 'mysql' {
+ class { '::ceilometer::db::mysql':
+ require => Exec['galera-ready'],
}
}
diff --git a/manifests/profile/pacemaker/ceilometer/api.pp b/manifests/profile/pacemaker/ceilometer/api.pp
index cfe103a..3006be8 100644
--- a/manifests/profile/pacemaker/ceilometer/api.pp
+++ b/manifests/profile/pacemaker/ceilometer/api.pp
@@ -40,13 +40,6 @@ class tripleo::profile::pacemaker::ceilometer::api (
pacemaker::resource::service { $::ceilometer::params::api_service_name :
clone_params => 'interleave=true',
}
- pacemaker::constraint::colocation { 'ceilometer-delay-with-ceilometer-api-colocation':
- source => 'delay-clone',
- target => "${::ceilometer::params::api_service_name}-clone",
- score => 'INFINITY',
- require => [Pacemaker::Resource::Service[$::ceilometer::params::api_service_name],
- Pacemaker::Resource::Ocf['delay']],
- }
}
}
diff --git a/manifests/profile/pacemaker/database/mysql.pp b/manifests/profile/pacemaker/database/mysql.pp
new file mode 100644
index 0000000..1acdf0d
--- /dev/null
+++ b/manifests/profile/pacemaker/database/mysql.pp
@@ -0,0 +1,184 @@
+# 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::database::mysql
+#
+# MySQL with Pacemaker profile for tripleo
+#
+# === Parameters
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+class tripleo::profile::pacemaker::database::mysql (
+ $step = hiera('step'),
+) {
+
+ if $::hostname == downcase(hiera('bootstrap_nodeid')) {
+ $pacemaker_master = true
+ } else {
+ $pacemaker_master = false
+ }
+ $mysql_bind_host = hiera('mysql_bind_host')
+ $galera_nodes = downcase(hiera('galera_node_names', $::hostname))
+ $galera_nodes_count = count(split($galera_nodes, ','))
+ $mysqld_options = {
+ 'mysqld' => {
+ 'skip-name-resolve' => '1',
+ 'binlog_format' => 'ROW',
+ 'default-storage-engine' => 'innodb',
+ 'innodb_autoinc_lock_mode' => '2',
+ 'innodb_locks_unsafe_for_binlog'=> '1',
+ 'query_cache_size' => '0',
+ 'query_cache_type' => '0',
+ 'bind-address' => $::hostname,
+ 'max_connections' => hiera('mysql_max_connections'),
+ 'open_files_limit' => '-1',
+ 'wsrep_on' => 'ON',
+ 'wsrep_provider' => '/usr/lib64/galera/libgalera_smm.so',
+ 'wsrep_cluster_name' => 'galera_cluster',
+ 'wsrep_cluster_address' => "gcomm://${galera_nodes}",
+ 'wsrep_slave_threads' => '1',
+ 'wsrep_certify_nonPK' => '1',
+ 'wsrep_max_ws_rows' => '131072',
+ 'wsrep_max_ws_size' => '1073741824',
+ 'wsrep_debug' => '0',
+ 'wsrep_convert_LOCK_to_trx' => '0',
+ 'wsrep_retry_autocommit' => '1',
+ 'wsrep_auto_increment_control' => '1',
+ 'wsrep_drupal_282555_workaround'=> '0',
+ 'wsrep_causal_reads' => '0',
+ 'wsrep_sst_method' => 'rsync',
+ 'wsrep_provider_options' => "gmcast.listen_addr=tcp://[${mysql_bind_host}]:4567;",
+ }
+ }
+
+ class { '::tripleo::profile::base::database::mysql':
+ manage_resources => false,
+ remove_default_accounts => $pacemaker_master,
+ mysql_server_options => $mysqld_options,
+ }
+
+ if hiera('step') >= 2 and $pacemaker_master {
+ if $pacemaker_master {
+ pacemaker::resource::ocf { 'galera' :
+ ocf_agent_name => 'heartbeat:galera',
+ op_params => 'promote timeout=300s on-fail=block',
+ master_params => '',
+ meta_params => "master-max=${galera_nodes_count} ordered=true",
+ resource_params => "additional_parameters='--open-files-limit=16384' enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}'",
+ require => Class['::mysql::server'],
+ before => Exec['galera-ready'],
+ }
+ exec { 'galera-ready' :
+ command => '/usr/bin/clustercheck >/dev/null',
+ timeout => 30,
+ tries => 180,
+ try_sleep => 10,
+ environment => ['AVAILABLE_WHEN_READONLY=0'],
+ require => Exec['create-root-sysconfig-clustercheck'],
+ }
+ # We add a clustercheck db user and we will switch /etc/sysconfig/clustercheck
+ # to it in a later step. We do this only on one node as it will replicate on
+ # the other members. We also make sure that the permissions are the minimum necessary
+ mysql_user { 'clustercheck@localhost':
+ ensure => 'present',
+ password_hash => mysql_password(hiera('mysql_clustercheck_password')),
+ require => Exec['galera-ready'],
+ }
+ mysql_grant { 'clustercheck@localhost/*.*':
+ ensure => 'present',
+ options => ['GRANT'],
+ privileges => ['PROCESS'],
+ table => '*.*',
+ user => 'clustercheck@localhost',
+ }
+ }
+ # This step is to create a sysconfig clustercheck file with the root user and empty password
+ # on the first install only (because later on the clustercheck db user will be used)
+ # We are using exec and not file in order to not have duplicate definition errors in puppet
+ # when we later set the the file to contain the clustercheck data
+ exec { 'create-root-sysconfig-clustercheck':
+ command => "/bin/echo 'MYSQL_USERNAME=root\nMYSQL_PASSWORD=\'\'\nMYSQL_HOST=localhost\n' > /etc/sysconfig/clustercheck",
+ unless => '/bin/test -e /etc/sysconfig/clustercheck && grep -q clustercheck /etc/sysconfig/clustercheck',
+ }
+ xinetd::service { 'galera-monitor' :
+ port => '9200',
+ server => '/usr/bin/clustercheck',
+ per_source => 'UNLIMITED',
+ log_on_success => '',
+ log_on_failure => 'HOST',
+ flags => 'REUSE',
+ service_type => 'UNLISTED',
+ user => 'root',
+ group => 'root',
+ require => Exec['create-root-sysconfig-clustercheck'],
+ }
+ }
+
+ if hiera('step') >= 4 or ( hiera('step') >= 3 and $pacemaker_master ) {
+ # At this stage we are guaranteed that the clustercheck db user exists
+ # so we switch the resource agent to use it.
+ $mysql_clustercheck_password = hiera('mysql_clustercheck_password')
+ file { '/etc/sysconfig/clustercheck' :
+ ensure => file,
+ mode => '0600',
+ owner => 'root',
+ group => 'root',
+ content => "MYSQL_USERNAME=clustercheck\n
+MYSQL_PASSWORD='${mysql_clustercheck_password}'\n
+MYSQL_HOST=localhost\n",
+ }
+ }
+
+ if hiera('step') >= 5 {
+ # We now make sure that the root db password is set to a random one
+ # At first installation /root/.my.cnf will be empty and we connect without a root
+ # password. On second runs or updates /root/.my.cnf will already be populated
+ # with proper credentials. This step happens on every node because this sql
+ # statement does not automatically replicate across nodes.
+ $mysql_root_password = hiera('mysql::server::root_password')
+ exec { 'galera-set-root-password':
+ command => "/bin/touch /root/.my.cnf && /bin/echo \"UPDATE mysql.user SET Password = PASSWORD('${mysql_root_password}') WHERE user = 'root'; flush privileges;\" | /bin/mysql --defaults-extra-file=/root/.my.cnf -u root",
+ }
+ file { '/root/.my.cnf' :
+ ensure => file,
+ mode => '0600',
+ owner => 'root',
+ group => 'root',
+ content => "[client]
+ user=root
+ password=\"${mysql_root_password}\"
+
+ [mysql]
+ user=root
+ password=\"${mysql_root_password}\"",
+ require => Exec['galera-set-root-password'],
+ }
+ if $pacemaker_master {
+ pacemaker::constraint::base { 'galera-then-openstack-core-constraint':
+ constraint_type => 'order',
+ first_resource => 'galera-master',
+ second_resource => 'openstack-core-clone',
+ first_action => 'promote',
+ second_action => 'start',
+ require => [Pacemaker::Resource::Ocf['galera'],
+ Pacemaker::Resource::Ocf['openstack-core']],
+ }
+ }
+ }
+
+}
diff --git a/manifests/profile/pacemaker/gnocchi.pp b/manifests/profile/pacemaker/gnocchi.pp
index ad566b1..98d1b36 100644
--- a/manifests/profile/pacemaker/gnocchi.pp
+++ b/manifests/profile/pacemaker/gnocchi.pp
@@ -31,16 +31,11 @@
# for more details.
# Defaults to hiera('step')
#
-# [*sync_db*]
-# (Optional) Whether to run db sync
-# Defaults to undef
-#
class tripleo::profile::pacemaker::gnocchi (
$gnocchi_indexer_backend = downcase(hiera('gnocchi_indexer_backend', 'mysql')),
$bootstrap_node = hiera('bootstrap_nodeid'),
$step = hiera('step'),
- $sync_db = true,
) {
Service <| tag == 'gnocchi-service' |> {
@@ -56,15 +51,18 @@ class tripleo::profile::pacemaker::gnocchi (
$pacemaker_master = false
}
- if $step >= 3 and $sync_db {
- include ::gnocchi
- include ::gnocchi::config
- include ::gnocchi::client
+ if $step >= 2 and $pacemaker_master {
if $gnocchi_indexer_backend == 'mysql' {
class { '::gnocchi::db::mysql':
require => Exec['galera-ready'],
}
}
+ }
+
+ if $step >= 3 and $pacemaker_master {
+ include ::gnocchi
+ include ::gnocchi::config
+ include ::gnocchi::client
include ::gnocchi::db::sync
}
diff --git a/manifests/profile/pacemaker/neutron.pp b/manifests/profile/pacemaker/neutron.pp
index fff731d..75a75b3 100644
--- a/manifests/profile/pacemaker/neutron.pp
+++ b/manifests/profile/pacemaker/neutron.pp
@@ -61,9 +61,7 @@ class tripleo::profile::pacemaker::neutron (
stop => '/bin/true',
}
- class { '::tripleo::profile::base::neutron':
- sync_db => ($::hostname == downcase($pacemaker_master)),
- }
+ include ::tripleo::profile::base::neutron
if $step >= 4 {
include ::neutron::params
diff --git a/manifests/profile/pacemaker/sahara.pp b/manifests/profile/pacemaker/sahara.pp
index 04b4edf..e6e5117 100644
--- a/manifests/profile/pacemaker/sahara.pp
+++ b/manifests/profile/pacemaker/sahara.pp
@@ -45,37 +45,5 @@ class tripleo::profile::pacemaker::sahara (
$pacemaker_master = false
}
- include ::tripleo::profile::base::sahara-api
- class { '::tripleo::profile::base::sahara-engine':
- sync_db => $pacemaker_master,
- }
-
- if $step >= 5 and $pacemaker_master {
- # Sahara
- pacemaker::resource::service { $::sahara::params::api_service_name :
- clone_params => 'interleave=true',
- require => Pacemaker::Resource::Ocf['openstack-core'],
- }
- pacemaker::resource::service { $::sahara::params::engine_service_name :
- clone_params => 'interleave=true',
- }
- pacemaker::constraint::base { 'keystone-then-sahara-api-constraint':
- constraint_type => 'order',
- first_resource => 'openstack-core-clone',
- second_resource => "${::sahara::params::api_service_name}-clone",
- first_action => 'start',
- second_action => 'start',
- require => [Pacemaker::Resource::Service[$::sahara::params::api_service_name],
- Pacemaker::Resource::Ocf['openstack-core']],
- }
- pacemaker::constraint::base { 'sahara-api-then-sahara-engine-constraint':
- constraint_type => 'order',
- first_resource => "${::sahara::params::api_service_name}-clone",
- second_resource => "${::sahara::params::engine_service_name}-clone",
- first_action => 'start',
- second_action => 'start',
- require => [Pacemaker::Resource::Service[$::sahara::params::api_service_name],
- Pacemaker::Resource::Service[$::sahara::params::engine_service_name]],
- }
- }
+ include ::tripleo::profile::base::sahara
}
diff --git a/manifests/profile/pacemaker/sahara/api.pp b/manifests/profile/pacemaker/sahara/api.pp
new file mode 100644
index 0000000..eed82dd
--- /dev/null
+++ b/manifests/profile/pacemaker/sahara/api.pp
@@ -0,0 +1,50 @@
+# 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::sahara::api
+#
+# Sahara API 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')
+#
+class tripleo::profile::pacemaker::sahara::api (
+ $bootstrap_node = hiera('bootstrap_nodeid'),
+ $step = hiera('step'),
+) {
+
+ if $::hostname == downcase($bootstrap_node) {
+ $pacemaker_master = true
+ } else {
+ $pacemaker_master = false
+ }
+
+ include ::tripleo::profile::pacemaker::sahara
+ include ::tripleo::profile::base::sahara::api
+
+ if $step >= 5 and $pacemaker_master {
+ # Sahara
+ pacemaker::resource::service { $::sahara::params::api_service_name :
+ clone_params => 'interleave=true',
+ }
+ }
+}
diff --git a/manifests/profile/pacemaker/sahara/engine.pp b/manifests/profile/pacemaker/sahara/engine.pp
new file mode 100644
index 0000000..6265e80
--- /dev/null
+++ b/manifests/profile/pacemaker/sahara/engine.pp
@@ -0,0 +1,51 @@
+# 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::sahara::engine
+#
+# Sahara Engine 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')
+#
+class tripleo::profile::pacemaker::sahara::engine (
+ $bootstrap_node = hiera('bootstrap_nodeid'),
+ $step = hiera('step'),
+) {
+
+ if $::hostname == downcase($bootstrap_node) {
+ $pacemaker_master = true
+ } else {
+ $pacemaker_master = false
+ }
+
+ include ::tripleo::profile::pacemaker::sahara
+ class { '::tripleo::profile::base::sahara::engine':
+ sync_db => $pacemaker_master
+ }
+
+ if $step >= 5 and $pacemaker_master {
+ pacemaker::resource::service { $::sahara::params::engine_service_name :
+ clone_params => 'interleave=true',
+ }
+ }
+}