Merge "Rework gnocchi-upgrade to run in a separate upgrade step"
[apex-tripleo-heat-templates.git] / extraconfig / tasks / mitaka_to_newton_ceilometer_wsgi_upgrade.pp
1 # Copyright 2015 Red Hat, Inc.
2 # All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
14 # under the License.
15
16 # This puppet manifest is to be used only during a Mitaka->Newton upgrade
17 # It configures ceilometer to be run under httpd but it makes sure to not
18 # restart any services. This snippet needs to be called before init as a
19 # pre upgrade migration.
20
21 Service <|
22   tag == 'ceilometer-service'
23 |> {
24   hasrestart => true,
25   restart    => '/bin/true',
26   start      => '/bin/true',
27   stop       => '/bin/true',
28 }
29
30 if $::hostname == downcase(hiera('bootstrap_nodeid')) {
31   $pacemaker_master = true
32   $sync_db = true
33 } else {
34   $pacemaker_master = false
35   $sync_db = false
36 }
37
38 include ::tripleo::packages
39
40
41 if str2bool(hiera('mongodb::server::ipv6', false)) {
42   $mongo_node_ips_with_port_prefixed = prefix(hiera('mongodb_node_ips'), '[')
43   $mongo_node_ips_with_port = suffix($mongo_node_ips_with_port_prefixed, ']:27017')
44 } else {
45   $mongo_node_ips_with_port = suffix(hiera('mongodb_node_ips'), ':27017')
46 }
47 $mongodb_replset = hiera('mongodb::server::replset')
48 $mongo_node_string = join($mongo_node_ips_with_port, ',')
49 $database_connection = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
50
51 include ::ceilometer
52
53 class {'::ceilometer::db':
54   database_connection => $database_connection,
55 }
56
57 if $sync_db  {
58   include ::ceilometer::db::sync
59 }
60
61 include ::ceilometer::config
62
63 class { '::ceilometer::api':
64   enabled           => true,
65   service_name      => 'httpd',
66   keystone_password => hiera('ceilometer::keystone::auth::password'),
67   identity_uri      => hiera('ceilometer::keystone::authtoken::auth_url'),
68   auth_uri          => hiera('ceilometer::keystone::authtoken::auth_uri'),
69   keystone_tenant   => hiera('ceilometer::keystone::authtoken::project_name'),
70 }
71
72 class { '::apache' :
73   service_enable  => false,
74   service_manage  => true,
75   service_restart => '/bin/true',
76   purge_configs   => false,
77   purge_vhost_dir => false,
78 }
79
80 # To ensure existing ports are not overridden
81 class { '::aodh::wsgi::apache':
82   servername => $::hostname,
83   ssl        => false,
84 }
85 class { '::gnocchi::wsgi::apache':
86   servername => $::hostname,
87   ssl        => false,
88 }
89
90 class { '::keystone::wsgi::apache':
91   servername => $::hostname,
92   ssl        => false,
93 }
94 class { '::ceilometer::wsgi::apache':
95   servername => $::hostname,
96   ssl        => false,
97 }