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