Merge "Optimize Nova disk_cachemodes and hw_disk_discard options for RBD"
[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') >= 1 {
22
23   create_resources(kmod::load, hiera('kernel_modules'), {})
24   create_resources(sysctl::value, hiera('sysctl_settings'), {})
25   Exec <| tag == 'kmod::load' |>  -> Sysctl <| |>
26
27 }
28
29 if hiera('step') >= 2 {
30
31   if count(hiera('ntp::servers')) > 0 {
32     include ::ntp
33   }
34
35   include ::timezone
36
37   # MongoDB
38   if downcase(hiera('ceilometer_backend')) == 'mongodb' {
39     include ::mongodb::globals
40     include ::mongodb::client
41     include ::mongodb::server
42     # NOTE(gfidente): We need to pass the list of IPv6 addresses *with* port and
43     # without the brackets as 'members' argument for the 'mongodb_replset'
44     # resource.
45     if str2bool(hiera('mongodb::server::ipv6', false)) {
46       $mongo_node_ips_with_port_prefixed = prefix(hiera('mongo_node_ips'), '[')
47       $mongo_node_ips_with_port = suffix($mongo_node_ips_with_port_prefixed, ']:27017')
48       $mongo_node_ips_with_port_nobr = suffix(hiera('mongo_node_ips'), ':27017')
49     } else {
50       $mongo_node_ips_with_port = suffix(hiera('mongo_node_ips'), ':27017')
51       $mongo_node_ips_with_port_nobr = suffix(hiera('mongo_node_ips'), ':27017')
52     }
53     $mongo_node_string = join($mongo_node_ips_with_port, ',')
54
55     $mongodb_replset = hiera('mongodb::server::replset')
56     $ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
57     if downcase(hiera('bootstrap_nodeid')) == $::hostname {
58       mongodb_replset { $mongodb_replset :
59         members => $mongo_node_ips_with_port_nobr,
60       }
61     }
62   }
63
64   # Redis
65   $redis_node_ips = hiera('redis_node_ips')
66   $redis_master_hostname = downcase(hiera('bootstrap_nodeid'))
67
68   if $redis_master_hostname == $::hostname {
69     $slaveof = undef
70   } else {
71     $slaveof = "${redis_master_hostname} 6379"
72   }
73   class {'::redis' :
74     slaveof => $slaveof,
75   }
76
77   if count($redis_node_ips) > 1 {
78     Class['::tripleo::redis_notification'] -> Service['redis-sentinel']
79     include ::redis::sentinel
80     include ::tripleo::redis_notification
81   }
82
83   if str2bool(hiera('enable_galera', true)) {
84     $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
85   } else {
86     $mysql_config_file = '/etc/my.cnf.d/server.cnf'
87   }
88   # TODO Galara
89   # FIXME: due to https://bugzilla.redhat.com/show_bug.cgi?id=1298671 we
90   # set bind-address to a hostname instead of an ip address; to move Mysql
91   # from internal_api on another network we'll have to customize both
92   # MysqlNetwork and ControllerHostnameResolveNetwork in ServiceNetMap
93   class { '::mysql::server':
94     config_file             => $mysql_config_file,
95     override_options        => {
96       'mysqld' => {
97         'bind-address'     => $::hostname,
98         'max_connections'  => hiera('mysql_max_connections'),
99         'open_files_limit' => '-1',
100       },
101     },
102     remove_default_accounts => true,
103   }
104
105   # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
106   # Create all the database schemas
107   include ::nova::db::mysql
108   include ::nova::db::mysql_api
109   include ::neutron::db::mysql
110   include ::cinder::db::mysql
111   include ::heat::db::mysql
112   include ::sahara::db::mysql
113   if downcase(hiera('gnocchi_indexer_backend')) == 'mysql' {
114     include ::gnocchi::db::mysql
115   }
116   if downcase(hiera('ceilometer_backend')) == 'mysql' {
117     include ::ceilometer::db::mysql
118     include ::aodh::db::mysql
119   }
120
121   # pre-install swift here so we can build rings
122   include ::swift
123
124   $enable_ceph = hiera('ceph_storage_count', 0) > 0 or hiera('enable_ceph_storage', false)
125
126   if $enable_ceph {
127     $mon_initial_members = downcase(hiera('ceph_mon_initial_members'))
128     if str2bool(hiera('ceph_ipv6', false)) {
129       $mon_host = hiera('ceph_mon_host_v6')
130     } else {
131       $mon_host = hiera('ceph_mon_host')
132     }
133     class { '::ceph::profile::params':
134       mon_initial_members => $mon_initial_members,
135       mon_host            => $mon_host,
136     }
137     include ::ceph::conf
138     include ::ceph::profile::mon
139   }
140
141   if str2bool(hiera('enable_ceph_storage', false)) {
142     if str2bool(hiera('ceph_osd_selinux_permissive', true)) {
143       exec { 'set selinux to permissive on boot':
144         command => "sed -ie 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config",
145         onlyif  => "test -f /etc/selinux/config && ! grep '^SELINUX=permissive' /etc/selinux/config",
146         path    => ['/usr/bin', '/usr/sbin'],
147       }
148
149       exec { 'set selinux to permissive':
150         command => 'setenforce 0',
151         onlyif  => "which setenforce && getenforce | grep -i 'enforcing'",
152         path    => ['/usr/bin', '/usr/sbin'],
153       } -> Class['ceph::profile::osd']
154     }
155
156     include ::ceph::conf
157     include ::ceph::profile::osd
158   }
159
160   if str2bool(hiera('enable_external_ceph', false)) {
161     if str2bool(hiera('ceph_ipv6', false)) {
162       $mon_host = hiera('ceph_mon_host_v6')
163     } else {
164       $mon_host = hiera('ceph_mon_host')
165     }
166     class { '::ceph::profile::params':
167       mon_host            => $mon_host,
168     }
169     include ::ceph::conf
170     include ::ceph::profile::client
171   }
172
173 } #END STEP 2
174
175 if hiera('step') >= 4 {
176
177   $nova_ipv6 = hiera('nova::use_ipv6', false)
178   if $nova_ipv6 {
179     $memcached_servers = suffix(hiera('memcache_node_ips_v6'), ':11211')
180   } else {
181     $memcached_servers = suffix(hiera('memcache_node_ips'), ':11211')
182   }
183
184   class { '::nova' :
185     memcached_servers => $memcached_servers
186   }
187   include ::nova::config
188   include ::nova::api
189   include ::nova::cert
190   include ::nova::conductor
191   include ::nova::consoleauth
192   include ::nova::network::neutron
193   include ::nova::vncproxy
194   include ::nova::scheduler
195   include ::nova::scheduler::filter
196
197   if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
198
199     # TODO(devvesa) provide non-controller ips for these services
200     $zookeeper_node_ips = hiera('neutron_api_node_ips')
201     $cassandra_node_ips = hiera('neutron_api_node_ips')
202
203     # Run zookeeper in the controller if configured
204     if hiera('enable_zookeeper_on_controller') {
205       class {'::tripleo::cluster::zookeeper':
206         zookeeper_server_ips => $zookeeper_node_ips,
207         # TODO: create a 'bind' hiera key for zookeeper
208         zookeeper_client_ip  => hiera('neutron::bind_host'),
209         zookeeper_hostnames  => hiera('controller_node_names')
210       }
211     }
212
213     # Run cassandra in the controller if configured
214     if hiera('enable_cassandra_on_controller') {
215       class {'::tripleo::cluster::cassandra':
216         cassandra_servers => $cassandra_node_ips,
217         # TODO: create a 'bind' hiera key for cassandra
218         cassandra_ip      => hiera('neutron::bind_host'),
219       }
220     }
221
222     class {'::tripleo::network::midonet::agent':
223       zookeeper_servers => $zookeeper_node_ips,
224       cassandra_seeds   => $cassandra_node_ips
225     }
226
227     class {'::tripleo::network::midonet::api':
228       zookeeper_servers    => $zookeeper_node_ips,
229       vip                  => hiera('tripleo::loadbalancer::public_virtual_ip'),
230       keystone_ip          => hiera('tripleo::loadbalancer::public_virtual_ip'),
231       keystone_admin_token => hiera('keystone::admin_token'),
232       # TODO: create a 'bind' hiera key for api
233       bind_address         => hiera('neutron::bind_host'),
234       admin_password       => hiera('admin_password')
235     }
236
237     # TODO: find a way to get an empty list from hiera
238     class {'::neutron':
239       service_plugins => []
240     }
241
242   }
243   else {
244
245     # ML2 plugin
246     include ::neutron
247   }
248
249   include ::neutron::config
250   include ::neutron::server
251   include ::neutron::server::notifications
252
253   # If the value of core plugin is set to 'nuage' or'opencontrail' or 'plumgrid',
254   # include nuage or opencontrail or plumgrid core plugins
255   # else use the default value of 'ml2'
256   if hiera('neutron::core_plugin') == 'neutron.plugins.nuage.plugin.NuagePlugin' {
257     include ::neutron::plugins::nuage
258   } elsif hiera('neutron::core_plugin') == 'neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2' {
259     include ::neutron::plugins::opencontrail
260   }
261   elsif hiera('neutron::core_plugin') == 'networking_plumgrid.neutron.plugins.plugin.NeutronPluginPLUMgridV2' {
262     class { '::neutron::plugins::plumgrid' :
263       connection                   => hiera('neutron::server::database_connection'),
264       controller_priv_host         => hiera('keystone_admin_api_vip'),
265       admin_password               => hiera('admin_password'),
266       metadata_proxy_shared_secret => hiera('nova::api::neutron_metadata_proxy_shared_secret'),
267     }
268   } else {
269
270     # If the value of core plugin is set to 'midonet',
271     # skip all the ML2 configuration
272     if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
273
274       class {'::neutron::plugins::midonet':
275         midonet_api_ip    => hiera('tripleo::loadbalancer::public_virtual_ip'),
276         keystone_tenant   => hiera('neutron::server::auth_tenant'),
277         keystone_password => hiera('neutron::server::auth_password')
278       }
279     } else {
280
281       include ::neutron::plugins::ml2
282       include ::neutron::agents::ml2::ovs
283
284       if 'cisco_n1kv' in hiera('neutron::plugins::ml2::mechanism_drivers') {
285         include ::neutron::plugins::ml2::cisco::nexus1000v
286
287         class { '::neutron::agents::n1kv_vem':
288           n1kv_source  => hiera('n1kv_vem_source', undef),
289           n1kv_version => hiera('n1kv_vem_version', undef),
290         }
291
292         class { '::n1k_vsm':
293           n1kv_source       => hiera('n1kv_vsm_source', undef),
294           n1kv_version      => hiera('n1kv_vsm_version', undef),
295           pacemaker_control => false,
296         }
297       }
298
299       if 'cisco_ucsm' in hiera('neutron::plugins::ml2::mechanism_drivers') {
300         include ::neutron::plugins::ml2::cisco::ucsm
301       }
302       if 'cisco_nexus' in hiera('neutron::plugins::ml2::mechanism_drivers') {
303         include ::neutron::plugins::ml2::cisco::nexus
304         include ::neutron::plugins::ml2::cisco::type_nexus_vxlan
305       }
306
307       if 'bsn_ml2' in hiera('neutron::plugins::ml2::mechanism_drivers') {
308         include ::neutron::plugins::ml2::bigswitch::restproxy
309         include ::neutron::agents::bigswitch
310       }
311       Service['neutron-server'] -> Service['neutron-ovs-agent-service']
312     }
313
314     Service['neutron-server'] -> Service['neutron-metadata']
315   }
316
317   include ::cinder
318   include ::cinder::config
319   include ::tripleo::ssl::cinder_config
320   include ::cinder::api
321   include ::cinder::glance
322   include ::cinder::scheduler
323   include ::cinder::volume
324   include ::cinder::ceilometer
325   class { '::cinder::setup_test_volume':
326     size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
327   }
328
329   $cinder_enable_iscsi = hiera('cinder_enable_iscsi_backend', true)
330   if $cinder_enable_iscsi {
331     $cinder_iscsi_backend = 'tripleo_iscsi'
332
333     cinder::backend::iscsi { $cinder_iscsi_backend :
334       iscsi_ip_address => hiera('cinder_iscsi_ip_address'),
335       iscsi_helper     => hiera('cinder_iscsi_helper'),
336     }
337   }
338
339   if $enable_ceph {
340
341     $ceph_pools = hiera('ceph_pools')
342     ceph::pool { $ceph_pools :
343       pg_num  => hiera('ceph::profile::params::osd_pool_default_pg_num'),
344       pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'),
345       size    => hiera('ceph::profile::params::osd_pool_default_size'),
346     }
347
348     $cinder_pool_requires = [Ceph::Pool[hiera('cinder_rbd_pool_name')]]
349
350   } else {
351     $cinder_pool_requires = []
352   }
353
354   if hiera('cinder_enable_rbd_backend', false) {
355     $cinder_rbd_backend = 'tripleo_ceph'
356
357     cinder::backend::rbd { $cinder_rbd_backend :
358       backend_host    => hiera('cinder::host'),
359       rbd_pool        => hiera('cinder_rbd_pool_name'),
360       rbd_user        => hiera('ceph_client_user_name'),
361       rbd_secret_uuid => hiera('ceph::profile::params::fsid'),
362       require         => $cinder_pool_requires,
363     }
364   }
365
366   if hiera('cinder_enable_eqlx_backend', false) {
367     $cinder_eqlx_backend = hiera('cinder::backend::eqlx::volume_backend_name')
368
369     cinder::backend::eqlx { $cinder_eqlx_backend :
370       volume_backend_name => hiera('cinder::backend::eqlx::volume_backend_name', undef),
371       san_ip              => hiera('cinder::backend::eqlx::san_ip', undef),
372       san_login           => hiera('cinder::backend::eqlx::san_login', undef),
373       san_password        => hiera('cinder::backend::eqlx::san_password', undef),
374       san_thin_provision  => hiera('cinder::backend::eqlx::san_thin_provision', undef),
375       eqlx_group_name     => hiera('cinder::backend::eqlx::eqlx_group_name', undef),
376       eqlx_pool           => hiera('cinder::backend::eqlx::eqlx_pool', undef),
377       eqlx_use_chap       => hiera('cinder::backend::eqlx::eqlx_use_chap', undef),
378       eqlx_chap_login     => hiera('cinder::backend::eqlx::eqlx_chap_login', undef),
379       eqlx_chap_password  => hiera('cinder::backend::eqlx::eqlx_san_password', undef),
380     }
381   }
382
383   if hiera('cinder_enable_dellsc_backend', false) {
384     $cinder_dellsc_backend = hiera('cinder::backend::dellsc_iscsi::volume_backend_name')
385
386     cinder::backend::dellsc_iscsi{ $cinder_dellsc_backend :
387       volume_backend_name   => hiera('cinder::backend::dellsc_iscsi::volume_backend_name', undef),
388       san_ip                => hiera('cinder::backend::dellsc_iscsi::san_ip', undef),
389       san_login             => hiera('cinder::backend::dellsc_iscsi::san_login', undef),
390       san_password          => hiera('cinder::backend::dellsc_iscsi::san_password', undef),
391       dell_sc_ssn           => hiera('cinder::backend::dellsc_iscsi::dell_sc_ssn', undef),
392       iscsi_ip_address      => hiera('cinder::backend::dellsc_iscsi::iscsi_ip_address', undef),
393       iscsi_port            => hiera('cinder::backend::dellsc_iscsi::iscsi_port', undef),
394       dell_sc_api_port      => hiera('cinder::backend::dellsc_iscsi::dell_sc_api_port', undef),
395       dell_sc_server_folder => hiera('cinder::backend::dellsc_iscsi::dell_sc_server_folder', undef),
396       dell_sc_volume_folder => hiera('cinder::backend::dellsc_iscsi::dell_sc_volume_folder', undef),
397     }
398   }
399
400   if hiera('cinder_enable_netapp_backend', false) {
401     $cinder_netapp_backend = hiera('cinder::backend::netapp::title')
402
403     if hiera('cinder::backend::netapp::nfs_shares', undef) {
404       $cinder_netapp_nfs_shares = split(hiera('cinder::backend::netapp::nfs_shares', undef), ',')
405     }
406
407     cinder::backend::netapp { $cinder_netapp_backend :
408       netapp_login                 => hiera('cinder::backend::netapp::netapp_login', undef),
409       netapp_password              => hiera('cinder::backend::netapp::netapp_password', undef),
410       netapp_server_hostname       => hiera('cinder::backend::netapp::netapp_server_hostname', undef),
411       netapp_server_port           => hiera('cinder::backend::netapp::netapp_server_port', undef),
412       netapp_size_multiplier       => hiera('cinder::backend::netapp::netapp_size_multiplier', undef),
413       netapp_storage_family        => hiera('cinder::backend::netapp::netapp_storage_family', undef),
414       netapp_storage_protocol      => hiera('cinder::backend::netapp::netapp_storage_protocol', undef),
415       netapp_transport_type        => hiera('cinder::backend::netapp::netapp_transport_type', undef),
416       netapp_vfiler                => hiera('cinder::backend::netapp::netapp_vfiler', undef),
417       netapp_volume_list           => hiera('cinder::backend::netapp::netapp_volume_list', undef),
418       netapp_vserver               => hiera('cinder::backend::netapp::netapp_vserver', undef),
419       netapp_partner_backend_name  => hiera('cinder::backend::netapp::netapp_partner_backend_name', undef),
420       nfs_shares                   => $cinder_netapp_nfs_shares,
421       nfs_shares_config            => hiera('cinder::backend::netapp::nfs_shares_config', undef),
422       netapp_copyoffload_tool_path => hiera('cinder::backend::netapp::netapp_copyoffload_tool_path', undef),
423       netapp_controller_ips        => hiera('cinder::backend::netapp::netapp_controller_ips', undef),
424       netapp_sa_password           => hiera('cinder::backend::netapp::netapp_sa_password', undef),
425       netapp_storage_pools         => hiera('cinder::backend::netapp::netapp_storage_pools', undef),
426       netapp_eseries_host_type     => hiera('cinder::backend::netapp::netapp_eseries_host_type', undef),
427       netapp_webservice_path       => hiera('cinder::backend::netapp::netapp_webservice_path', undef),
428     }
429   }
430
431   if hiera('cinder_enable_nfs_backend', false) {
432     $cinder_nfs_backend = 'tripleo_nfs'
433
434     if str2bool($::selinux) {
435       selboolean { 'virt_use_nfs':
436         value      => on,
437         persistent => true,
438       } -> Package['nfs-utils']
439     }
440
441     package {'nfs-utils': } ->
442     cinder::backend::nfs { $cinder_nfs_backend :
443       nfs_servers       => hiera('cinder_nfs_servers'),
444       nfs_mount_options => hiera('cinder_nfs_mount_options',''),
445       nfs_shares_config => '/etc/cinder/shares-nfs.conf',
446     }
447   }
448
449   $cinder_enabled_backends = delete_undef_values([$cinder_iscsi_backend, $cinder_rbd_backend, $cinder_eqlx_backend, $cinder_dellsc_backend, $cinder_netapp_backend, $cinder_nfs_backend])
450   class { '::cinder::backends' :
451     enabled_backends => union($cinder_enabled_backends, hiera('cinder_user_enabled_backends')),
452   }
453
454   # swift proxy
455   include ::swift::proxy
456   include ::swift::proxy::proxy_logging
457   include ::swift::proxy::healthcheck
458   include ::swift::proxy::cache
459   include ::swift::proxy::keystone
460   include ::swift::proxy::authtoken
461   include ::swift::proxy::staticweb
462   include ::swift::proxy::ratelimit
463   include ::swift::proxy::catch_errors
464   include ::swift::proxy::tempurl
465   include ::swift::proxy::formpost
466
467   # swift storage
468   if str2bool(hiera('enable_swift_storage', true)) {
469     class { '::swift::storage::all':
470       mount_check => str2bool(hiera('swift_mount_check')),
471     }
472     if(!defined(File['/srv/node'])) {
473       file { '/srv/node':
474         ensure  => directory,
475         owner   => 'swift',
476         group   => 'swift',
477         require => Package['openstack-swift'],
478       }
479     }
480     $swift_components = ['account', 'container', 'object']
481     swift::storage::filter::recon { $swift_components : }
482     swift::storage::filter::healthcheck { $swift_components : }
483   }
484
485   # Ceilometer
486   $ceilometer_backend = downcase(hiera('ceilometer_backend'))
487   case $ceilometer_backend {
488     /mysql/ : {
489       $ceilometer_database_connection = hiera('ceilometer_mysql_conn_string')
490     }
491     default : {
492       $ceilometer_database_connection = $ceilometer_mongodb_conn_string
493     }
494   }
495   include ::ceilometer
496   include ::ceilometer::config
497   include ::ceilometer::api
498   include ::ceilometer::agent::notification
499   include ::ceilometer::agent::central
500   include ::ceilometer::expirer
501   include ::ceilometer::collector
502   include ::ceilometer::agent::auth
503   include ::ceilometer::dispatcher::gnocchi
504   class { '::ceilometer::db' :
505     database_connection => $ceilometer_database_connection,
506   }
507
508   Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
509
510   # Aodh
511   class { '::aodh' :
512     database_connection => $ceilometer_database_connection,
513   }
514   include ::aodh::db::sync
515   # To manage the upgrade:
516   Exec['ceilometer-dbsync'] -> Exec['aodh-db-sync']
517   include ::aodh::auth
518   include ::aodh::api
519   include ::aodh::wsgi::apache
520   include ::aodh::evaluator
521   include ::aodh::notifier
522   include ::aodh::listener
523   include ::aodh::client
524
525   # Heat
526   class { '::heat' :
527     notification_driver => 'messaging',
528   }
529   include ::heat::config
530   include ::heat::api
531   include ::heat::api_cfn
532   include ::heat::api_cloudwatch
533   include ::heat::engine
534
535   # Sahara
536   include ::sahara
537   include ::sahara::service::api
538   include ::sahara::service::engine
539
540   # Horizon
541   include ::apache::mod::remoteip
542   if 'cisco_n1kv' in hiera('neutron::plugins::ml2::mechanism_drivers') {
543     $_profile_support = 'cisco'
544   } else {
545     $_profile_support = 'None'
546   }
547   $neutron_options   = {'profile_support' => $_profile_support }
548
549   $memcached_ipv6 = hiera('memcached_ipv6', false)
550   if $memcached_ipv6 {
551     $horizon_memcached_servers = hiera('memcache_node_ips_v6', '[::1]')
552   } else {
553     $horizon_memcached_servers = hiera('memcache_node_ips', '127.0.0.1')
554   }
555
556   class { '::horizon':
557     cache_server_ip => $horizon_memcached_servers,
558     neutron_options => $neutron_options,
559   }
560
561   # Gnocchi
562   $gnocchi_database_connection = hiera('gnocchi_mysql_conn_string')
563   class { '::gnocchi':
564     database_connection => $gnocchi_database_connection,
565   }
566   include ::gnocchi::api
567   include ::gnocchi::wsgi::apache
568   include ::gnocchi::client
569   include ::gnocchi::db::sync
570   include ::gnocchi::storage
571   include ::gnocchi::metricd
572   include ::gnocchi::statsd
573   $gnocchi_backend = downcase(hiera('gnocchi_backend', 'swift'))
574   case $gnocchi_backend {
575       'swift': { include ::gnocchi::storage::swift }
576       'file': { include ::gnocchi::storage::file }
577       'rbd': { include ::gnocchi::storage::ceph }
578       default: { fail('Unrecognized gnocchi_backend parameter.') }
579   }
580
581   $snmpd_user = hiera('snmpd_readonly_user_name')
582   snmp::snmpv3_user { $snmpd_user:
583     authtype => 'MD5',
584     authpass => hiera('snmpd_readonly_user_password'),
585   }
586   class { '::snmp':
587     agentaddress => ['udp:161','udp6:[::1]:161'],
588     snmpd_config => [ join(['createUser ', hiera('snmpd_readonly_user_name'), ' MD5 "', hiera('snmpd_readonly_user_password'), '"']), join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc  cron', 'includeAllDisks  10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ],
589   }
590
591   hiera_include('controller_classes')
592
593 } #END STEP 4
594
595 if hiera('step') >= 5 {
596   $nova_enable_db_purge = hiera('nova_enable_db_purge', true)
597   $cinder_enable_db_purge = hiera('cinder_enable_db_purge', true)
598   $heat_enable_db_purge = hiera('heat_enable_db_purge', true)
599
600   if $nova_enable_db_purge {
601     include ::nova::cron::archive_deleted_rows
602   }
603   if $cinder_enable_db_purge {
604     include ::cinder::cron::db_purge
605   }
606   if $heat_enable_db_purge {
607     include ::heat::cron::purge_deleted
608   }
609
610   if downcase(hiera('bootstrap_nodeid')) == $::hostname {
611     # Class ::heat::keystone::domain has to run on bootstrap node
612     # because it creates DB entities via API calls.
613     include ::heat::keystone::domain
614
615     Class['::keystone::roles::admin'] -> Class['::heat::keystone::domain']
616   } else {
617     # On non-bootstrap node we don't need to create Keystone resources again
618     class { '::heat::keystone::domain':
619       manage_domain => false,
620       manage_user   => false,
621       manage_role   => false,
622     }
623   }
624
625 } #END STEP 5
626
627 $package_manifest_name = join(['/var/lib/tripleo/installed-packages/overcloud_controller', hiera('step')])
628 package_manifest{$package_manifest_name: ensure => present}