diff options
Diffstat (limited to 'manifests/profile')
45 files changed, 1899 insertions, 24 deletions
diff --git a/manifests/profile/base/ceilometer.pp b/manifests/profile/base/ceilometer.pp new file mode 100644 index 0000000..a7d62ce --- /dev/null +++ b/manifests/profile/base/ceilometer.pp @@ -0,0 +1,43 @@ +# 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::ceilometer +# +# Ceilometer profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*pacemaker_master*] +# (Optional) The master node runs some tasks +# one step earlier than others; disable to +# the node is not the master. +# Defaults to true + +class tripleo::profile::base::ceilometer ( + $step = hiera('step'), + $pacemaker_master = true, +) { + + if $step >= 4 or ($step >= 3 and $pacemaker_master) { + include ::ceilometer + include ::ceilometer::db + include ::ceilometer::config + } + +} diff --git a/manifests/profile/base/ceilometer/agent/central.pp b/manifests/profile/base/ceilometer/agent/central.pp new file mode 100644 index 0000000..02d6d1a --- /dev/null +++ b/manifests/profile/base/ceilometer/agent/central.pp @@ -0,0 +1,38 @@ +# 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::ceilometer::agent::central +# +# Ceilometer Central Agent 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::ceilometer::agent::central ( + $step = hiera('step'), +) { + + include ::tripleo::profile::base::ceilometer + + if $step >= 4 { + include ::ceilometer::agent::auth + include ::ceilometer::agent::central + } + +} diff --git a/manifests/profile/base/ceilometer/agent/compute.pp b/manifests/profile/base/ceilometer/agent/compute.pp new file mode 100644 index 0000000..3a7aa50 --- /dev/null +++ b/manifests/profile/base/ceilometer/agent/compute.pp @@ -0,0 +1,38 @@ +# 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::ceilometer::agent::compute +# +# Ceilometer Compute Agent 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::ceilometer::agent::compute ( + $step = hiera('step'), +) { + + include ::tripleo::profile::base::ceilometer + + if $step >= 4 { + include ::ceilometer::agent::auth + include ::ceilometer::agent::compute + } + +} diff --git a/manifests/profile/base/ceilometer/agent/notification.pp b/manifests/profile/base/ceilometer/agent/notification.pp new file mode 100644 index 0000000..83a0234 --- /dev/null +++ b/manifests/profile/base/ceilometer/agent/notification.pp @@ -0,0 +1,38 @@ +# 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::ceilometer::agent::notification +# +# Ceilometer Notification Agent 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::ceilometer::agent::notification ( + $step = hiera('step'), +) { + + include ::tripleo::profile::base::ceilometer + + if $step >= 4 { + include ::ceilometer::agent::auth + include ::ceilometer::agent::notification + } + +} diff --git a/manifests/profile/base/ceilometer/api.pp b/manifests/profile/base/ceilometer/api.pp new file mode 100644 index 0000000..e324c00 --- /dev/null +++ b/manifests/profile/base/ceilometer/api.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::profile::base::ceilometer::api +# +# Ceilometer 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::ceilometer::api ( + $step = hiera('step'), +) { + + include ::tripleo::profile::base::ceilometer + + if $step >= 4 { + include ::ceilometer::api + } + +} diff --git a/manifests/profile/base/ceilometer/collector.pp b/manifests/profile/base/ceilometer/collector.pp new file mode 100644 index 0000000..6891f9c --- /dev/null +++ b/manifests/profile/base/ceilometer/collector.pp @@ -0,0 +1,52 @@ +# 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::ceilometer::collector +# +# Ceilometer Collector profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*sync_db*] +# (Optional) Whether to run db sync +# Defaults to true +# + +class tripleo::profile::base::ceilometer::collector ( + $step = hiera('step'), + $sync_db = true, +) { + + class { '::tripleo::profile::base::ceilometer': + pacemaker_master => $sync_db, + } + + if $step >= 3 and $sync_db { + $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb')) + if $ceilometer_backend == 'mysql' { + include ::ceilometer::db::mysql + } + } + + if $step >= 4 { + include ::ceilometer::collector + include ::ceilometer::dispatcher::gnocchi + } + +} diff --git a/manifests/profile/base/ceilometer/expirer.pp b/manifests/profile/base/ceilometer/expirer.pp new file mode 100644 index 0000000..43d8c26 --- /dev/null +++ b/manifests/profile/base/ceilometer/expirer.pp @@ -0,0 +1,38 @@ +# 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::ceilometer::expirer +# +# Ceilometer Expirer 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::ceilometer::expirer ( + $step = hiera('step'), +) { + + include ::tripleo::profile::base::ceilometer + + if $step >= 4 { + include ::ceilometer::expirer + Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" } + } + +} diff --git a/manifests/profile/base/ceph.pp b/manifests/profile/base/ceph.pp new file mode 100644 index 0000000..29ca9ae --- /dev/null +++ b/manifests/profile/base/ceph.pp @@ -0,0 +1,70 @@ +# 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::ceph +# +# Ceph base profile for tripleo +# +# === Parameters +# +# [*ceph_ipv6*] +# (Optional) Force daemons to bind on IPv6 addresses +# Defaults to false +# +# [*ceph_mon_initial_members*] +# (Optional) List of IP addresses to use as mon_initial_members +# Defaults to undef +# +# [*ceph_mon_host*] +# (Optional) List of IP addresses to use as mon_host +# Deftauls to undef +# +# [*ceph_mon_host_v6*] +# (Optional) List of IPv6 addresses, surrounded by brackets, used as +# mon_host when ceph_ipv6 is true +# 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::ceph ( + $ceph_ipv6 = false, + $ceph_mon_initial_members = undef, + $ceph_mon_host = undef, + $ceph_mon_host_v6 = undef, + $step = hiera('step'), +) { + + if $step >= 2 { + if $ceph_mon_initial_members { + $mon_initial_members = downcase($ceph_mon_initial_members) + } else { + $mon_initial_members = undef + } + if $ceph_ipv6 { + $mon_host = $ceph_mon_host_v6 + } else { + $mon_host = $ceph_mon_host + } + + class { '::ceph::profile::params': + mon_initial_members => $mon_initial_members, + mon_host => $mon_host, + } + + include ::ceph::conf + } +} diff --git a/manifests/profile/base/ceph/client.pp b/manifests/profile/base/ceph/client.pp new file mode 100644 index 0000000..851324a --- /dev/null +++ b/manifests/profile/base/ceph/client.pp @@ -0,0 +1,35 @@ +# 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::ceph::client +# +# Ceph client 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::ceph::client ( + $step = hiera('step'), +) { + + include ::tripleo::profile::base::ceph + + if $step >= 2 { + include ::ceph::profile::client + } +} diff --git a/manifests/profile/base/ceph/mon.pp b/manifests/profile/base/ceph/mon.pp new file mode 100644 index 0000000..48c3721 --- /dev/null +++ b/manifests/profile/base/ceph/mon.pp @@ -0,0 +1,48 @@ +# 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::ceph::mon +# +# Ceph Monitor profile for tripleo +# +# === Parameters +# +# [*ceph_pools*] +# (Optional) List of pools to create +# Defaults to [] +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +class tripleo::profile::base::ceph::mon ( + $ceph_pools = [], + $step = hiera('step'), +) { + + include ::tripleo::profile::base::ceph + + if $step >= 2 { + include ::ceph::profile::mon + } + + if $step >= 4 { + ceph::pool { $ceph_pools : + pg_num => hiera('ceph::profile::params::osd_pool_default_pg_num'), + pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'), + size => hiera('ceph::profile::params::osd_pool_default_size'), + } + } +} diff --git a/manifests/profile/base/ceph/osd.pp b/manifests/profile/base/ceph/osd.pp new file mode 100644 index 0000000..d0c77e9 --- /dev/null +++ b/manifests/profile/base/ceph/osd.pp @@ -0,0 +1,54 @@ +# 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::ceph::osd +# +# Ceph OSD profile for tripleo +# +# === Parameters +# +# [*ceph_osd_selinux_permissive*] +# (Optional) Wheter to configure SELinux in permissive mode +# Default to true +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +class tripleo::profile::base::ceph::osd ( + $ceph_osd_selinux_permissive = true, + $step = hiera('step'), +) { + + include ::tripleo::profile::base::ceph + + if $step >= 2 { + if $ceph_osd_selinux_permissive { + exec { 'set selinux to permissive on boot': + command => "sed -ie 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config", + onlyif => "test -f /etc/selinux/config && ! grep '^SELINUX=permissive' /etc/selinux/config", + path => ['/usr/bin', '/usr/sbin'], + } + + exec { 'set selinux to permissive': + command => 'setenforce 0', + onlyif => "which setenforce && getenforce | grep -i 'enforcing'", + path => ['/usr/bin', '/usr/sbin'], + } -> Class['ceph::profile::osd'] + } + + include ::ceph::profile::osd + } +} diff --git a/manifests/profile/base/database/mongodb.pp b/manifests/profile/base/database/mongodb.pp new file mode 100644 index 0000000..4c53c9c --- /dev/null +++ b/manifests/profile/base/database/mongodb.pp @@ -0,0 +1,54 @@ +# 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::mongodb +# +# Mongodb profile for tripleo +# +# === Parameters +# +# [*mongodb_replset*] +# Mongodb replicaset name +# +# [*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::base::database::mongodb ( + $mongodb_replset, + $bootstrap_node = downcase(hiera('bootstrap_nodeid')), + $step = hiera('step'), +) { + + if $step >= 2 { + + include ::mongodb::globals + include ::mongodb::client + include ::mongodb::server + + include ::tripleo::profile::base::database::mongodbcommon + + if $bootstrap_node == $::hostname { + mongodb_replset { $mongodb_replset : + members => $tripleo::profile::base::database::mongodbcommon::mongo_node_ips_with_port_nobr, + } + } + + } +} diff --git a/manifests/profile/base/database/mongodbcommon.pp b/manifests/profile/base/database/mongodbcommon.pp new file mode 100644 index 0000000..6530730 --- /dev/null +++ b/manifests/profile/base/database/mongodbcommon.pp @@ -0,0 +1,52 @@ +# 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::mongodb +# +# Mongodb profile for tripleo +# +# === Parameters +# +# [*mongodb_node_ips*] +# List of The mongodb node ip addresses +# +# [*mongodb_ipv6_enabled*] +# A boolean value for mongodb server ipv6 is enabled or not +# Defaults to false +# +class tripleo::profile::base::database::mongodbcommon ( + $mongodb_node_ips = hiera('mongo_node_ips'), + $mongodb_ipv6_enabled = false, +) { + + $port = '27017' + + # NOTE(gfidente): the following vars are needed on all nodes so they + # need to stay out of pacemaker_master conditional. + # The addresses mangling will hopefully go away when we'll be able to + # configure the connection string via hostnames, until then, 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($mongodb_ipv6_enabled) { + $mongo_node_ips_with_port_prefixed = prefix($mongodb_node_ips, '[') + $mongo_node_ips_with_port = suffix( + $mongo_node_ips_with_port_prefixed, "]:${port}") + $mongo_node_ips_with_port_nobr = suffix($mongodb_node_ips, ":${port}") + } else { + $mongo_node_ips_with_port = suffix($mongodb_node_ips, ":${port}") + $mongo_node_ips_with_port_nobr = suffix($mongodb_node_ips, ":${port}") + } + $mongo_node_string = join($mongo_node_ips_with_port, ',') + +} diff --git a/manifests/profile/base/keystone.pp b/manifests/profile/base/keystone.pp index a5060b8..706b78f 100644 --- a/manifests/profile/base/keystone.pp +++ b/manifests/profile/base/keystone.pp @@ -22,10 +22,6 @@ # (Optional) Whether to run db sync # Defaults to true # -# [*bootstrap_master*] -# (Optional) The hostname of the node responsible for bootstrapping -# Defaults to hiera('bootstrap_nodeid') -# # [*manage_roles*] # (Optional) whether to create keystone admin role # Defaults to true @@ -44,12 +40,11 @@ # Defaults to hiera('step') # class tripleo::profile::base::keystone ( - $sync_db = true, - $bootstrap_master = undef, - $manage_roles = true, - $manage_endpoint = true, - $manage_db_purge = hiera('keystone_enable_db_purge', true), - $step = hiera('step'), + $sync_db = true, + $manage_roles = true, + $manage_endpoint = true, + $manage_db_purge = hiera('keystone_enable_db_purge', true), + $step = hiera('step'), ) { if $step >= 3 and $sync_db { @@ -59,7 +54,7 @@ class tripleo::profile::base::keystone ( if $step >= 4 or ( $step >= 3 and $sync_db ) { class { '::keystone': sync_db => $sync_db, - enable_bootstrap => $bootstrap_master, + enable_bootstrap => $sync_db, } include ::keystone::config diff --git a/manifests/profile/base/neutron/ml2.pp b/manifests/profile/base/neutron/ml2.pp index d18638e..59c74c8 100644 --- a/manifests/profile/base/neutron/ml2.pp +++ b/manifests/profile/base/neutron/ml2.pp @@ -37,6 +37,8 @@ class tripleo::profile::base::neutron::ml2 ( $step = hiera('step'), ) { + warning('This class is going is deprecated and will be removed very soon, replaced by tripleo::profile::base::neutron::plugins::ml2.') + if $step >= 4 or ( $step >= 3 and $sync_db ) { include ::neutron::plugins::ml2 include ::tripleo::profile::base::neutron diff --git a/manifests/profile/base/neutron/plugins/ml2.pp b/manifests/profile/base/neutron/plugins/ml2.pp new file mode 100644 index 0000000..b462e1b --- /dev/null +++ b/manifests/profile/base/neutron/plugins/ml2.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::plugins::ml2 +# +# Neutron ML2 plugin profile for tripleo +# +# === Parameters +# +# [*mechanism_drivers*] +# (Optional) The mechanism drivers to use with the Ml2 plugin +# Defaults to hiera('neutron::plugins::ml2::mechanism_drivers') +# +# [*sync_db*] +# (Optional) Whether to run Neutron DB sync operations +# 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::neutron::plugins::ml2 ( + $mechanism_drivers = hiera('neutron::plugins::ml2::mechanism_drivers'), + $sync_db = true, + $step = hiera('step'), +) { + + if $step >= 4 or ( $step >= 3 and $sync_db ) { + include ::neutron::plugins::ml2 + include ::tripleo::profile::base::neutron + + if 'cisco_n1kv' in $mechanism_drivers { + include ::tripleo::profile::base::neutron::n1k + } + + if 'cisco_ucsm' in $mechanism_drivers { + include ::neutron::plugins::ml2::cisco::ucsm + } + + if 'cisco_nexus' in $mechanism_drivers { + include ::neutron::plugins::ml2::cisco::nexus + include ::neutron::plugins::ml2::cisco::type_nexus_vxlan + } + + if 'bsn_ml2' in $mechanism_drivers { + include ::neutron::plugins::ml2::bigswitch::restproxy + include ::neutron::agents::bigswitch + } + } +} diff --git a/manifests/profile/base/neutron/plugins/nuage.pp b/manifests/profile/base/neutron/plugins/nuage.pp new file mode 100644 index 0000000..20f93db --- /dev/null +++ b/manifests/profile/base/neutron/plugins/nuage.pp @@ -0,0 +1,35 @@ +# Copyright 2014 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::plugins::nuage +# +# Nuage Neutron profile for tripleo +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*sync_db*] +# (Optional) Whether to run Neutron DB sync operations +# Defaults to undef +# +class tripleo::profile::base::neutron::plugins::nuage ( + $step = hiera('step'), + $sync_db = true, +) { + if $step >= 4 or ( $step >= 3 and $sync_db ) { + include ::neutron::plugins::nuage + } +} diff --git a/manifests/profile/base/neutron/plugins/opencontrail.pp b/manifests/profile/base/neutron/plugins/opencontrail.pp new file mode 100644 index 0000000..1fcb627 --- /dev/null +++ b/manifests/profile/base/neutron/plugins/opencontrail.pp @@ -0,0 +1,35 @@ +# Copyright 2014 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::plugins::opencontrail +# +# Opencontrail Neutron profile for tripleo +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*sync_db*] +# (Optional) Whether to run Neutron DB sync operations +# Defaults to undef +# +class tripleo::profile::base::neutron::plugins::opencontrail ( + $step = hiera('step'), + $sync_db = true, +) { + if $step >= 4 or ( $step >= 3 and $sync_db ) { + include ::neutron::plugins::opencontrail + } +} diff --git a/manifests/profile/base/neutron/plugins/plumgrid.pp b/manifests/profile/base/neutron/plugins/plumgrid.pp new file mode 100644 index 0000000..7f645b9 --- /dev/null +++ b/manifests/profile/base/neutron/plugins/plumgrid.pp @@ -0,0 +1,37 @@ +# Copyright 2016 PLUMgrid, 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::plugins::plumgrid +# +# PLUMgrid Neutron profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*sync_db*] +# (Optional) Whether to run Neutron DB sync operations +# Defaults to undef +# +class tripleo::profile::base::neutron::plugins::plumgrid ( + $step = hiera('step'), + $sync_db = true, +) { + if $step >= 4 or ( $step >= 3 and $sync_db ) { + include ::neutron::plugins::plumgrid + } +} diff --git a/manifests/profile/base/nova/api.pp b/manifests/profile/base/nova/api.pp new file mode 100644 index 0000000..4064b1e --- /dev/null +++ b/manifests/profile/base/nova/api.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::base::nova::api +# +# Nova API profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*sync_db*] +# (Optional) Whether to run db sync +# Defaults to true +# +class tripleo::profile::base::nova::api ( + $step = hiera('step'), + $sync_db = true, +) { + + include ::tripleo::profile::base::nova + + if $step >= 2 and $sync_db { + include ::nova::db::mysql + include ::nova::db::mysql_api + Exec<| title == 'galera-ready'|> -> Anchor['nova::db::begin'] + } + + if $step >= 4 or ($step >= 3 and $sync_db) { + class { '::nova::api': + sync_db => $sync_db, + sync_db_api => $sync_db, + } + include ::nova::network::neutron + } +} + diff --git a/manifests/profile/base/nova/compute.pp b/manifests/profile/base/nova/compute.pp new file mode 100644 index 0000000..579b474 --- /dev/null +++ b/manifests/profile/base/nova/compute.pp @@ -0,0 +1,41 @@ +# 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::nova::compute +# +# Nova Compute 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::nova::compute ( + $step = hiera('step'), +) { + + if $step >= 4 { + # deploy basic bits for nova + include ::tripleo::profile::base::nova + + # deploy basic bits for nova-compute + include ::nova::compute + + # deploy bits to connect nova compute to neutron + include ::nova::network::neutron + } + +} diff --git a/manifests/profile/base/nova/compute/libvirt.pp b/manifests/profile/base/nova/compute/libvirt.pp new file mode 100644 index 0000000..74af7fc --- /dev/null +++ b/manifests/profile/base/nova/compute/libvirt.pp @@ -0,0 +1,66 @@ +# 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::nova::compute::libvirt +# +# Nova Compute Libvirt 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::nova::compute::libvirt ( + $step = hiera('step'), +) { + + if $step >= 4 { + include ::tripleo::profile::base::nova::compute + + # Ceph + Libvirt + $rbd_ephemeral_storage = hiera('nova::compute::rbd::ephemeral_storage', false) + $rbd_persistent_storage = hiera('rbd_persistent_storage', false) + if $rbd_ephemeral_storage or $rbd_persistent_storage { + $client_keys = hiera('ceph::profile::params::client_keys') + $client_user = join(['client.', hiera('tripleo::profile::base::cinder::volume::rbd::cinder_rbd_user_name')]) + class { '::nova::compute::rbd': + libvirt_rbd_secret_key => $client_keys[$client_user]['secret'], + } + } + + # TODO(emilien): Some work needs to be done in puppet-nova to separate nova-compute config + # when running libvirt and libvirt itself, so we allow micro-services deployments. + if str2bool(hiera('nova::use_ipv6', false)) { + $vncserver_listen = '::0' + } else { + $vncserver_listen = '0.0.0.0' + } + + if $rbd_ephemeral_storage { + class { '::nova::compute::libvirt': + libvirt_disk_cachemodes => ['network=writeback'], + libvirt_hw_disk_discard => 'unmap', + vncserver_listen => $vncserver_listen, + } + } else { + class { '::nova::compute::libvirt' : + vncserver_listen => $vncserver_listen, + } + } + + } + +} diff --git a/manifests/profile/base/nova/consoleauth.pp b/manifests/profile/base/nova/consoleauth.pp new file mode 100644 index 0000000..442cf84 --- /dev/null +++ b/manifests/profile/base/nova/consoleauth.pp @@ -0,0 +1,35 @@ +# 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::nova::consoleauth +# +# Nova Consoleauth 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::nova::consoleauth ( + $step = hiera('step'), +) { + + if $step >= 4 { + include ::tripleo::profile::base::nova + include ::nova::consoleauth + } + +} diff --git a/manifests/profile/base/nova/libvirt.pp b/manifests/profile/base/nova/libvirt.pp new file mode 100644 index 0000000..29ef372 --- /dev/null +++ b/manifests/profile/base/nova/libvirt.pp @@ -0,0 +1,49 @@ +# 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::nova::libvirt +# +# Libvirt profile for tripleo. It will deploy Libvirt service and configure it. +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +class tripleo::profile::base::nova::libvirt ( + $step = hiera('step'), +) { + + if $step >= 4 { + include ::tripleo::profile::base::nova + include ::nova::compute::libvirt::services + + file { ['/etc/libvirt/qemu/networks/autostart/default.xml', + '/etc/libvirt/qemu/networks/default.xml']: + ensure => absent, + before => Service['libvirt'], + } + + # in case libvirt has been already running before the Puppet run, make + # sure the default network is destroyed + exec { 'libvirt-default-net-destroy': + command => '/usr/bin/virsh net-destroy default', + onlyif => '/usr/bin/virsh net-info default | /bin/grep -i "^active:\s*yes"', + before => Service['libvirt'], + } + } + +} diff --git a/manifests/profile/base/nova/scheduler.pp b/manifests/profile/base/nova/scheduler.pp new file mode 100644 index 0000000..13b4e82 --- /dev/null +++ b/manifests/profile/base/nova/scheduler.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::nova::scheduler +# +# Nova Scheduler 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::nova::scheduler ( + $step = hiera('step'), +) { + + if $step >= 4 { + include ::tripleo::profile::base::nova + include ::nova::scheduler + include ::nova::scheduler::filter + } + +} diff --git a/manifests/profile/base/neutron/nuage.pp b/manifests/profile/base/nova/vncproxy.pp index 62e6c4f..aa0cc7b 100644 --- a/manifests/profile/base/neutron/nuage.pp +++ b/manifests/profile/base/nova/vncproxy.pp @@ -1,4 +1,4 @@ -# Copyright 2014 Red Hat, Inc. +# 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 @@ -12,20 +12,24 @@ # License for the specific language governing permissions and limitations # under the License. # -# == Class: tripleo::profile::base::neutron:nuage: +# == Class: tripleo::profile::base::nova::vncproxy # -# Nuage Neutron profile for tripleo +# Nova vncproxy 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::neutron::nuage ( +class tripleo::profile::base::nova::vncproxy ( $step = hiera('step'), ) { - include ::tripleo::profile::base::neutron::server + if $step >= 4 { - include ::neutron::plugins::nuage + include ::tripleo::profile::base::nova + include ::nova::vncproxy } + } diff --git a/manifests/profile/base/snmp.pp b/manifests/profile/base/snmp.pp new file mode 100644 index 0000000..40f7393 --- /dev/null +++ b/manifests/profile/base/snmp.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::snmp +# +# SNMP profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*snmpd_user*] +# The SNMP username +# Defaults to hiera('snmpd_readonly_user_name') +# +# [*snmpd_password*] +# The SNMP password +# Defaults to hiera('snmpd_readonly_user_password') +# +class tripleo::profile::base::snmp ( + $step = hiera('step'), + $snmpd_user = hiera('snmpd_readonly_user_name'), + $snmpd_password = hiera('snmpd_readonly_user_password'), +) { + + if $step >= 4 { + snmp::snmpv3_user { $snmpd_user: + authtype => 'MD5', + authpass => $snmpd_password, + } + class { '::snmp': + agentaddress => ['udp:161','udp6:[::1]:161'], + snmpd_config => [ join(['createUser ', $snmpd_user, ' MD5 "', $snmpd_password, '"']), join(['rouser ', $snmpd_user]), 'proc cron', 'includeAllDisks 10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ], + } + } +} diff --git a/manifests/profile/pacemaker/ceilometer.pp b/manifests/profile/pacemaker/ceilometer.pp new file mode 100644 index 0000000..0c21807 --- /dev/null +++ b/manifests/profile/pacemaker/ceilometer.pp @@ -0,0 +1,138 @@ +# 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::ceilometer +# +# Ceilometer 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') +# +# [*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'], + } + } + } + + # NOTE(emilien): the constraints won't live forever here as we're moving to + # pacemaker-lite architecture. + + # Fedora doesn't know `require-all` parameter for constraints yet + if $::operatingsystem == 'Fedora' { + $redis_ceilometer_constraint_params = undef + } else { + $redis_ceilometer_constraint_params = 'require-all=false' + } + pacemaker::constraint::base { 'redis-then-ceilometer-central-constraint': + constraint_type => 'order', + first_resource => 'redis-master', + second_resource => "${::ceilometer::params::agent_central_service_name}-clone", + first_action => 'promote', + second_action => 'start', + constraint_params => $redis_ceilometer_constraint_params, + require => [Pacemaker::Resource::Ocf['redis'], + Pacemaker::Resource::Service[$::ceilometer::params::agent_central_service_name]], + } + pacemaker::constraint::base { 'keystone-then-ceilometer-central-constraint': + constraint_type => 'order', + first_resource => 'openstack-core-clone', + second_resource => "${::ceilometer::params::agent_central_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::ceilometer::params::agent_central_service_name], + Pacemaker::Resource::Ocf['openstack-core']], + } + pacemaker::constraint::base { 'keystone-then-ceilometer-notification-constraint': + constraint_type => 'order', + first_resource => 'openstack-core-clone', + second_resource => "${::ceilometer::params::agent_notification_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::ceilometer::params::agent_central_service_name], + Pacemaker::Resource::Ocf['openstack-core']], + } + pacemaker::constraint::base { 'ceilometer-central-then-ceilometer-collector-constraint': + constraint_type => 'order', + first_resource => "${::ceilometer::params::agent_central_service_name}-clone", + second_resource => "${::ceilometer::params::collector_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::ceilometer::params::agent_central_service_name], + Pacemaker::Resource::Service[$::ceilometer::params::collector_service_name]], + } + pacemaker::constraint::base { 'ceilometer-collector-then-ceilometer-api-constraint': + constraint_type => 'order', + first_resource => "${::ceilometer::params::collector_service_name}-clone", + second_resource => "${::ceilometer::params::api_service_name}-clone", + first_action => 'start', + second_action => 'start', + require => [Pacemaker::Resource::Service[$::ceilometer::params::collector_service_name], + Pacemaker::Resource::Service[$::ceilometer::params::api_service_name]], + } + pacemaker::constraint::colocation { 'ceilometer-api-with-ceilometer-collector-colocation': + source => "${::ceilometer::params::api_service_name}-clone", + target => "${::ceilometer::params::collector_service_name}-clone", + score => 'INFINITY', + require => [Pacemaker::Resource::Service[$::ceilometer::params::api_service_name], + Pacemaker::Resource::Service[$::ceilometer::params::collector_service_name]], + } + } + +} diff --git a/manifests/profile/pacemaker/ceilometer/agent/central.pp b/manifests/profile/pacemaker/ceilometer/agent/central.pp new file mode 100644 index 0000000..e227614 --- /dev/null +++ b/manifests/profile/pacemaker/ceilometer/agent/central.pp @@ -0,0 +1,58 @@ +# 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::ceilometer::agent::central +# +# Ceilometer Central Agent Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*pacemaker_master*] +# (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::ceilometer::agent::central ( + $pacemaker_master = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + + include ::ceilometer::params + include ::tripleo::profile::pacemaker::ceilometer + include ::tripleo::profile::base::ceilometer::agent::central + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb')) + case downcase(hiera('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]], + } + } + } + } + +} diff --git a/manifests/profile/pacemaker/ceilometer/agent/notification.pp b/manifests/profile/pacemaker/ceilometer/agent/notification.pp new file mode 100644 index 0000000..868bb22 --- /dev/null +++ b/manifests/profile/pacemaker/ceilometer/agent/notification.pp @@ -0,0 +1,45 @@ +# 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::ceilometer::agent::notification +# +# Ceilometer Notification Agent Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*pacemaker_master*] +# (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::ceilometer::agent::notification ( + $pacemaker_master = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + + include ::ceilometer::params + include ::tripleo::profile::pacemaker::ceilometer + include ::tripleo::profile::base::ceilometer::agent::notification + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + pacemaker::resource::service { $::ceilometer::params::agent_notification_service_name : + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/ceilometer/api.pp b/manifests/profile/pacemaker/ceilometer/api.pp new file mode 100644 index 0000000..cfe103a --- /dev/null +++ b/manifests/profile/pacemaker/ceilometer/api.pp @@ -0,0 +1,52 @@ +# 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::ceilometer::api +# +# Ceilometer API Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*pacemaker_master*] +# (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::ceilometer::api ( + $pacemaker_master = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + + include ::ceilometer::params + include ::tripleo::profile::pacemaker::ceilometer + include ::tripleo::profile::base::ceilometer::api + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + 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/ceilometer/collector.pp b/manifests/profile/pacemaker/ceilometer/collector.pp new file mode 100644 index 0000000..2a838f2 --- /dev/null +++ b/manifests/profile/pacemaker/ceilometer/collector.pp @@ -0,0 +1,57 @@ +# 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::ceilometer::collector +# +# Ceilometer Collector Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*pacemaker_master*] +# (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') +# +# [*sync_db*] +# (Optional) Whether to run db sync +# Defaults to undef +# +class tripleo::profile::pacemaker::ceilometer::collector ( + $pacemaker_master = hiera('bootstrap_nodeid'), + $step = hiera('step'), + $sync_db = true, +) { + + include ::ceilometer::params + include ::tripleo::profile::pacemaker::ceilometer + + class { '::tripleo::profile::base::ceilometer::collector': + sync_db => (downcase($::hostname) == $pacemaker_master), + } + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb')) + if $ceilometer_backend == 'mysql' { + Exec<| title == 'galera-ready'|> -> Class['ceilometer::db::mysql'] + } + pacemaker::resource::service { $::ceilometer::params::collector_service_name : + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/database/mongodb.pp b/manifests/profile/pacemaker/database/mongodb.pp new file mode 100644 index 0000000..15c84d7 --- /dev/null +++ b/manifests/profile/pacemaker/database/mongodb.pp @@ -0,0 +1,74 @@ +# 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::mongodb +# +# Mongodb Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*mongodb_replset*] +# Mongodb replicaset name +# +# [*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::database::mongodb ( + $mongodb_replset, + $bootstrap_node = hiera('bootstrap_nodeid'), + $step = hiera('step'), +) { + + if $step >= 1 { + include ::mongodb::globals + include ::mongodb::client + include ::mongodb::server + } + + if $step >= 2 { + + include ::tripleo::profile::base::database::mongodbcommon + + if $::hostname == downcase($bootstrap_node) { + $pacemaker_master = true + } else { + $pacemaker_master = false + } + + if $pacemaker_master { + pacemaker::resource::service { $::mongodb::params::service_name : + op_params => 'start timeout=370s stop timeout=200s', + clone_params => true, + require => Class['::mongodb::server'], + } + # NOTE (spredzy) : The replset can only be run + # once all the nodes have joined the cluster. + tripleo::profile::pacemaker::database::mongodbvalidator { + $tripleo::profile::base::database::mongodbcommon::mongodb_node_ips : + port => $tripleo::profile::base::database::mongodbcommon::port, + require => Pacemaker::Resource::Service[$::mongodb::params::service_name], + before => Mongodb_replset[$mongodb_replset], + } + mongodb_replset { $mongodb_replset : + members => $tripleo::profile::base::database::mongodbcommon::mongo_node_ips_with_port_nobr, + } + } + } +} diff --git a/manifests/profile/pacemaker/database/mongodbvalidator.pp b/manifests/profile/pacemaker/database/mongodbvalidator.pp new file mode 100644 index 0000000..95d3bd7 --- /dev/null +++ b/manifests/profile/pacemaker/database/mongodbvalidator.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::profile::pacemaker::database::mongodb::conn_validator +# +# Connection validator for a node that serves MongoDB. This is done to be able +# to iterate through the different servers in a more seamless way. +# +# === Parameters +# +# [*title*] +# the title or namevar of the resource will be used as the server of the +# actual mongodb_conn_validator. +# +# [*port*] +# The port in which the MongoDB server is listening on. +# +define tripleo::profile::pacemaker::database::mongodbvalidator( + $port, +) { + mongodb_conn_validator { "${title}_conn_validator" : + server => $title, + port => $port, + timeout => '600', + } +} diff --git a/manifests/profile/pacemaker/keystone.pp b/manifests/profile/pacemaker/keystone.pp index 42c44d4..497d6f3 100644 --- a/manifests/profile/pacemaker/keystone.pp +++ b/manifests/profile/pacemaker/keystone.pp @@ -59,10 +59,9 @@ class tripleo::profile::pacemaker::keystone ( } class { '::tripleo::profile::base::keystone': - sync_db => $pacemaker_master, - bootstrap_master => $pacemaker_master, - manage_roles => $manage_roles, - manage_endpoint => $manage_roles + sync_db => $pacemaker_master, + manage_roles => $manage_roles, + manage_endpoint => $manage_roles } if $step >= 5 and $pacemaker_master and $enable_load_balancer { diff --git a/manifests/profile/pacemaker/neutron/ml2.pp b/manifests/profile/pacemaker/neutron/ml2.pp index 8acaf21..ab5a219 100644 --- a/manifests/profile/pacemaker/neutron/ml2.pp +++ b/manifests/profile/pacemaker/neutron/ml2.pp @@ -26,10 +26,12 @@ class tripleo::profile::pacemaker::neutron::ml2 ( $pacemaker_master = hiera('bootstrap_nodeid'), ) { + warning('This class is going is deprecated and will be removed very soon, replaced by tripleo::profile::pacemaker::neutron::plugins::ml2.') + include ::neutron::params include ::tripleo::profile::pacemaker::neutron - class { '::tripleo::profile::base::neutron::ml2': + class { '::tripleo::profile::base::neutron::plugins::ml2': sync_db => ($::hostname == downcase($pacemaker_master)) } diff --git a/manifests/profile/pacemaker/neutron/plugins/ml2.pp b/manifests/profile/pacemaker/neutron/plugins/ml2.pp new file mode 100644 index 0000000..5ec363b --- /dev/null +++ b/manifests/profile/pacemaker/neutron/plugins/ml2.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::pacemaker::neutron::plugins::ml2 +# +# Neutron ML2 driver Pacemaker HA profile for tripleo +# +# === Parameters +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::neutron::plugins::ml2 ( + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + include ::neutron::params + include ::tripleo::profile::pacemaker::neutron + + class { '::tripleo::profile::base::neutron::plugins::ml2': + sync_db => ($::hostname == downcase($pacemaker_master)) + } + +} diff --git a/manifests/profile/pacemaker/neutron/plugins/nuage.pp b/manifests/profile/pacemaker/neutron/plugins/nuage.pp new file mode 100644 index 0000000..6b38884 --- /dev/null +++ b/manifests/profile/pacemaker/neutron/plugins/nuage.pp @@ -0,0 +1,33 @@ +# 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::neutron::plugins::nuage +# +# Nuage Neutron profile for tripleo pacemaker +# +# === Parameters +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::neutron::plugins::nuage ( + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + class { '::tripleo::profile::base::neutron::plugins::nuage': + sync_db => ($::hostname == downcase($pacemaker_master)) + } + +} diff --git a/manifests/profile/pacemaker/neutron/plugins/opencontrail.pp b/manifests/profile/pacemaker/neutron/plugins/opencontrail.pp new file mode 100644 index 0000000..32564f4 --- /dev/null +++ b/manifests/profile/pacemaker/neutron/plugins/opencontrail.pp @@ -0,0 +1,33 @@ +# 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::neutron::plugins::opencontrail +# +# Opencontrail Neutron profile for tripleo pacemaker +# +# === Parameters +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::neutron::plugins::opencontrail ( + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + class { '::tripleo::profile::base::neutron::plugins::opencontrail': + sync_db => ($::hostname == downcase($pacemaker_master)) + } + +} diff --git a/manifests/profile/pacemaker/neutron/plugins/plumgrid.pp b/manifests/profile/pacemaker/neutron/plugins/plumgrid.pp new file mode 100644 index 0000000..1f2b32a --- /dev/null +++ b/manifests/profile/pacemaker/neutron/plugins/plumgrid.pp @@ -0,0 +1,33 @@ +# Copyright 2016 PLUMgrid, 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::neutron::plugins::plumgrid +# +# PLUMgrid Neutron profile for tripleo pacemaker +# +# === Parameters +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::neutron::plugins::plumgrid ( + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + class { '::tripleo::profile::base::neutron::plugins::plumgrid': + sync_db => ($::hostname == downcase($pacemaker_master)) + } + +} diff --git a/manifests/profile/pacemaker/neutron/server.pp b/manifests/profile/pacemaker/neutron/server.pp index fa00b3e..0bad1b9 100644 --- a/manifests/profile/pacemaker/neutron/server.pp +++ b/manifests/profile/pacemaker/neutron/server.pp @@ -35,12 +35,12 @@ class tripleo::profile::pacemaker::neutron::server ( include ::neutron::params include ::tripleo::profile::pacemaker::neutron - if $step >= 2 { + $sync_db = ($::hostname == downcase($pacemaker_master)) + if $step >= 2 and $sync_db { include ::neutron::db::mysql Exec<| title == 'galera-ready'|> -> Class['neutron::db::mysql'] } - $sync_db = ($::hostname == downcase($pacemaker_master)) if $step >= 4 or ( $step >= 3 and $sync_db ) { include ::neutron::server::notifications include ::neutron::server diff --git a/manifests/profile/pacemaker/nova/api.pp b/manifests/profile/pacemaker/nova/api.pp new file mode 100644 index 0000000..5d8e11f --- /dev/null +++ b/manifests/profile/pacemaker/nova/api.pp @@ -0,0 +1,48 @@ +# 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::nova::api +# +# Nova API with Pacemaker profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to downcase(hiera('bootstrap_nodeid')) +# +class tripleo::profile::pacemaker::nova::api ( + $step = hiera('step'), + $pacemaker_master = downcase(hiera('bootstrap_nodeid')), +) { + + include ::nova::params + include ::tripleo::profile::pacemaker::nova + + class { '::tripleo::profile::base::nova::api': + sync_db => (downcase($::hostname) == $pacemaker_master), + } + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + pacemaker::resource::service { $::nova::params::api_service_name: + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/nova/consoleauth.pp b/manifests/profile/pacemaker/nova/consoleauth.pp new file mode 100644 index 0000000..54f17b7 --- /dev/null +++ b/manifests/profile/pacemaker/nova/consoleauth.pp @@ -0,0 +1,45 @@ +# 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::nova::consoleauth +# +# Nova Consoleauth with Pacemaker profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::nova::consoleauth ( + $step = hiera('step'), + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + include ::nova::params + include ::tripleo::profile::pacemaker::nova + include ::tripleo::profile::base::nova::consoleauth + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + pacemaker::resource::service { $::nova::params::consoleauth_service_name: + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/nova/scheduler.pp b/manifests/profile/pacemaker/nova/scheduler.pp new file mode 100644 index 0000000..6516394 --- /dev/null +++ b/manifests/profile/pacemaker/nova/scheduler.pp @@ -0,0 +1,45 @@ +# 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::nova::scheduler +# +# Nova Scheduler with Pacemaker profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::nova::scheduler ( + $step = hiera('step'), + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + include ::nova::params + include ::tripleo::profile::pacemaker::nova + include ::tripleo::profile::base::nova::scheduler + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + pacemaker::resource::service { $::nova::params::scheduler_service_name: + clone_params => 'interleave=true', + } + } + +} diff --git a/manifests/profile/pacemaker/nova/vncproxy.pp b/manifests/profile/pacemaker/nova/vncproxy.pp new file mode 100644 index 0000000..7f7d095 --- /dev/null +++ b/manifests/profile/pacemaker/nova/vncproxy.pp @@ -0,0 +1,45 @@ +# 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::nova::vncproxy +# +# Nova vncproxy with Pacemaker profile for tripleo +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*pacemaker_master*] +# (Optional) The hostname of the pacemaker master +# Defaults to hiera('bootstrap_nodeid') +# +class tripleo::profile::pacemaker::nova::vncproxy ( + $step = hiera('step'), + $pacemaker_master = hiera('bootstrap_nodeid'), +) { + + include ::nova::params + include ::tripleo::profile::pacemaker::nova + include ::tripleo::profile::base::nova::vncproxy + + if $step >= 5 and downcase($::hostname) == $pacemaker_master { + pacemaker::resource::service { $::nova::params::vncproxy_service_name: + clone_params => 'interleave=true', + } + } + +} |