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