Re-enable Ceilometer composable roles for controller
[apex-tripleo-heat-templates.git] / puppet / manifests / overcloud_controller.pp
1 # Copyright 2014 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 include ::tripleo::packages
17 include ::tripleo::firewall
18
19 $enable_load_balancer = hiera('enable_load_balancer', true)
20
21 if hiera('step') >= 2 {
22   if str2bool(hiera('enable_galera', true)) {
23     $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
24   } else {
25     $mysql_config_file = '/etc/my.cnf.d/server.cnf'
26   }
27   # TODO Galara
28   # FIXME: due to https://bugzilla.redhat.com/show_bug.cgi?id=1298671 we
29   # set bind-address to a hostname instead of an ip address; to move Mysql
30   # from internal_api on another network we'll have to customize both
31   # MysqlNetwork and ControllerHostnameResolveNetwork in ServiceNetMap
32   class { '::mysql::server':
33     config_file             => $mysql_config_file,
34     override_options        => {
35       'mysqld' => {
36         'bind-address'     => $::hostname,
37         'max_connections'  => hiera('mysql_max_connections'),
38         'open_files_limit' => '-1',
39       },
40     },
41     remove_default_accounts => true,
42   }
43
44   # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
45   # Create all the database schemas
46   if downcase(hiera('gnocchi_indexer_backend')) == 'mysql' {
47     include ::gnocchi::db::mysql
48   }
49   include ::aodh::db::mysql
50
51 } #END STEP 2
52
53 if hiera('step') >= 4 {
54
55   $nova_ipv6 = hiera('nova::use_ipv6', false)
56   if $nova_ipv6 {
57     $memcached_servers = suffix(hiera('memcache_node_ips_v6'), ':11211')
58   } else {
59     $memcached_servers = suffix(hiera('memcache_node_ips'), ':11211')
60   }
61
62   class { '::nova' :
63     memcached_servers => $memcached_servers
64   }
65   include ::nova::config
66
67   # Aodh
68   class { '::aodh' :
69     database_connection => hiera('aodh_mysql_conn_string'),
70   }
71   include ::aodh::db::sync
72   include ::aodh::auth
73   include ::aodh::api
74   include ::aodh::wsgi::apache
75   include ::aodh::evaluator
76   include ::aodh::notifier
77   include ::aodh::listener
78   include ::aodh::client
79
80   # Horizon
81   include ::apache::mod::remoteip
82   if 'cisco_n1kv' in hiera('neutron::plugins::ml2::mechanism_drivers') {
83     $_profile_support = 'cisco'
84   } else {
85     $_profile_support = 'None'
86   }
87   $neutron_options   = merge({'profile_support' => $_profile_support },hiera('horizon::neutron_options',undef))
88
89   $memcached_ipv6 = hiera('memcached_ipv6', false)
90   if $memcached_ipv6 {
91     $horizon_memcached_servers = hiera('memcache_node_ips_v6', '[::1]')
92   } else {
93     $horizon_memcached_servers = hiera('memcache_node_ips', '127.0.0.1')
94   }
95
96   class { '::horizon':
97     cache_server_ip => $horizon_memcached_servers,
98     neutron_options => $neutron_options,
99   }
100
101   # Gnocchi
102   $gnocchi_database_connection = hiera('gnocchi_mysql_conn_string')
103   class { '::gnocchi':
104     database_connection => $gnocchi_database_connection,
105   }
106   include ::gnocchi::api
107   include ::gnocchi::wsgi::apache
108   include ::gnocchi::client
109   include ::gnocchi::db::sync
110   include ::gnocchi::storage
111   include ::gnocchi::metricd
112   include ::gnocchi::statsd
113   $gnocchi_backend = downcase(hiera('gnocchi_backend', 'swift'))
114   case $gnocchi_backend {
115       'swift': { include ::gnocchi::storage::swift }
116       'file': { include ::gnocchi::storage::file }
117       'rbd': { include ::gnocchi::storage::ceph }
118       default: { fail('Unrecognized gnocchi_backend parameter.') }
119   }
120
121   hiera_include('controller_classes')
122
123 } #END STEP 4
124
125 if hiera('step') >= 5 {
126   $nova_enable_db_purge = hiera('nova_enable_db_purge', true)
127
128   if $nova_enable_db_purge {
129     include ::nova::cron::archive_deleted_rows
130   }
131 } #END STEP 5
132
133 $package_manifest_name = join(['/var/lib/tripleo/installed-packages/overcloud_controller', hiera('step')])
134 package_manifest{$package_manifest_name: ensure => present}