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