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