Merge "Add missing createUser line to /etc/snmp/snmpd.conf"
[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 ::glance::notify::rabbitmq
233   include join(['::glance::backend::', $glance_backend])
234
235   class { '::nova' :
236     memcached_servers => suffix(hiera('memcache_node_ips'), ':11211'),
237   }
238   include ::nova::config
239   include ::nova::api
240   include ::nova::cert
241   include ::nova::conductor
242   include ::nova::consoleauth
243   include ::nova::network::neutron
244   include ::nova::vncproxy
245   include ::nova::scheduler
246   include ::nova::scheduler::filter
247
248   if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
249
250     # TODO(devvesa) provide non-controller ips for these services
251     $zookeeper_node_ips = hiera('neutron_api_node_ips')
252     $cassandra_node_ips = hiera('neutron_api_node_ips')
253
254     # Run zookeeper in the controller if configured
255     if hiera('enable_zookeeper_on_controller') {
256       class {'::tripleo::cluster::zookeeper':
257         zookeeper_server_ips => $zookeeper_node_ips,
258         # TODO: create a 'bind' hiera key for zookeeper
259         zookeeper_client_ip  => hiera('neutron::bind_host'),
260         zookeeper_hostnames  => hiera('controller_node_names')
261       }
262     }
263
264     # Run cassandra in the controller if configured
265     if hiera('enable_cassandra_on_controller') {
266       class {'::tripleo::cluster::cassandra':
267         cassandra_servers => $cassandra_node_ips,
268         # TODO: create a 'bind' hiera key for cassandra
269         cassandra_ip      => hiera('neutron::bind_host'),
270       }
271     }
272
273     class {'::tripleo::network::midonet::agent':
274       zookeeper_servers => $zookeeper_node_ips,
275       cassandra_seeds   => $cassandra_node_ips
276     }
277
278     class {'::tripleo::network::midonet::api':
279       zookeeper_servers    => $zookeeper_node_ips,
280       vip                  => hiera('tripleo::loadbalancer::public_virtual_ip'),
281       keystone_ip          => hiera('tripleo::loadbalancer::public_virtual_ip'),
282       keystone_admin_token => hiera('keystone::admin_token'),
283       # TODO: create a 'bind' hiera key for api
284       bind_address         => hiera('neutron::bind_host'),
285       admin_password       => hiera('admin_password')
286     }
287
288     # TODO: find a way to get an empty list from hiera
289     class {'::neutron':
290       service_plugins => []
291     }
292
293   }
294   else {
295
296     # ML2 plugin
297     include ::neutron
298   }
299
300   include ::neutron::config
301   include ::neutron::server
302   include ::neutron::server::notifications
303
304   # If the value of core plugin is set to 'nuage' or 'opencontrail',
305   # include nuage or opencontrail core plugins, and it does not
306   # need the l3, dhcp and metadata agents
307   if hiera('neutron::core_plugin') == 'neutron.plugins.nuage.plugin.NuagePlugin' {
308     include ::neutron::plugins::nuage
309   } elsif hiera('neutron::core_plugin') == 'neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2' {
310     include ::neutron::plugins::opencontrail
311   } else {
312     include ::neutron::agents::l3
313     include ::neutron::agents::dhcp
314     include ::neutron::agents::metadata
315
316     file { '/etc/neutron/dnsmasq-neutron.conf':
317       content => hiera('neutron_dnsmasq_options'),
318       owner   => 'neutron',
319       group   => 'neutron',
320       notify  => Service['neutron-dhcp-service'],
321       require => Package['neutron'],
322     }
323
324     # If the value of core plugin is set to 'midonet',
325     # skip all the ML2 configuration
326     if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
327
328       class {'::neutron::plugins::midonet':
329         midonet_api_ip    => hiera('tripleo::loadbalancer::public_virtual_ip'),
330         keystone_tenant   => hiera('neutron::server::auth_tenant'),
331         keystone_password => hiera('neutron::server::auth_password')
332       }
333     } else {
334
335       include ::neutron::plugins::ml2
336       include ::neutron::agents::ml2::ovs
337
338       if 'cisco_n1kv' in hiera('neutron::plugins::ml2::mechanism_drivers') {
339         include ::neutron::plugins::ml2::cisco::nexus1000v
340
341         class { '::neutron::agents::n1kv_vem':
342           n1kv_source  => hiera('n1kv_vem_source', undef),
343           n1kv_version => hiera('n1kv_vem_version', undef),
344         }
345
346         class { '::n1k_vsm':
347           n1kv_source       => hiera('n1kv_vsm_source', undef),
348           n1kv_version      => hiera('n1kv_vsm_version', undef),
349           pacemaker_control => false,
350         }
351       }
352
353       if 'cisco_ucsm' in hiera('neutron::plugins::ml2::mechanism_drivers') {
354         include ::neutron::plugins::ml2::cisco::ucsm
355       }
356       if 'cisco_nexus' in hiera('neutron::plugins::ml2::mechanism_drivers') {
357         include ::neutron::plugins::ml2::cisco::nexus
358         include ::neutron::plugins::ml2::cisco::type_nexus_vxlan
359       }
360
361       if 'bsn_ml2' in hiera('neutron::plugins::ml2::mechanism_drivers') {
362         include ::neutron::plugins::ml2::bigswitch::restproxy
363         include ::neutron::agents::bigswitch
364       }
365       neutron_l3_agent_config {
366         'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
367       }
368       neutron_dhcp_agent_config {
369         'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
370       }
371       Service['neutron-server'] -> Service['neutron-ovs-agent-service']
372     }
373
374     Service['neutron-server'] -> Service['neutron-dhcp-service']
375     Service['neutron-server'] -> Service['neutron-l3']
376     Service['neutron-server'] -> Service['neutron-metadata']
377   }
378
379   include ::cinder
380   include ::cinder::config
381   include ::tripleo::ssl::cinder_config
382   include ::cinder::api
383   include ::cinder::glance
384   include ::cinder::scheduler
385   include ::cinder::volume
386   include ::cinder::ceilometer
387   class { '::cinder::setup_test_volume':
388     size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
389   }
390
391   $cinder_enable_iscsi = hiera('cinder_enable_iscsi_backend', true)
392   if $cinder_enable_iscsi {
393     $cinder_iscsi_backend = 'tripleo_iscsi'
394
395     cinder::backend::iscsi { $cinder_iscsi_backend :
396       iscsi_ip_address => hiera('cinder_iscsi_ip_address'),
397       iscsi_helper     => hiera('cinder_iscsi_helper'),
398     }
399   }
400
401   if $enable_ceph {
402
403     $ceph_pools = hiera('ceph_pools')
404     ceph::pool { $ceph_pools :
405       pg_num  => hiera('ceph::profile::params::osd_pool_default_pg_num'),
406       pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'),
407       size    => hiera('ceph::profile::params::osd_pool_default_size'),
408     }
409
410     $cinder_pool_requires = [Ceph::Pool[hiera('cinder_rbd_pool_name')]]
411
412   } else {
413     $cinder_pool_requires = []
414   }
415
416   if hiera('cinder_enable_rbd_backend', false) {
417     $cinder_rbd_backend = 'tripleo_ceph'
418
419     cinder::backend::rbd { $cinder_rbd_backend :
420       rbd_pool        => hiera('cinder_rbd_pool_name'),
421       rbd_user        => hiera('ceph_client_user_name'),
422       rbd_secret_uuid => hiera('ceph::profile::params::fsid'),
423       require         => $cinder_pool_requires,
424     }
425   }
426
427   if hiera('cinder_enable_eqlx_backend', false) {
428     $cinder_eqlx_backend = hiera('cinder::backend::eqlx::volume_backend_name')
429
430     cinder::backend::eqlx { $cinder_eqlx_backend :
431       volume_backend_name => hiera('cinder::backend::eqlx::volume_backend_name', undef),
432       san_ip              => hiera('cinder::backend::eqlx::san_ip', undef),
433       san_login           => hiera('cinder::backend::eqlx::san_login', undef),
434       san_password        => hiera('cinder::backend::eqlx::san_password', undef),
435       san_thin_provision  => hiera('cinder::backend::eqlx::san_thin_provision', undef),
436       eqlx_group_name     => hiera('cinder::backend::eqlx::eqlx_group_name', undef),
437       eqlx_pool           => hiera('cinder::backend::eqlx::eqlx_pool', undef),
438       eqlx_use_chap       => hiera('cinder::backend::eqlx::eqlx_use_chap', undef),
439       eqlx_chap_login     => hiera('cinder::backend::eqlx::eqlx_chap_login', undef),
440       eqlx_chap_password  => hiera('cinder::backend::eqlx::eqlx_san_password', undef),
441     }
442   }
443
444   if hiera('cinder_enable_dellsc_backend', false) {
445     $cinder_dellsc_backend = hiera('cinder::backend::dellsc_iscsi::volume_backend_name')
446
447     cinder::backend::dellsc_iscsi{ $cinder_dellsc_backend :
448       volume_backend_name   => hiera('cinder::backend::dellsc_iscsi::volume_backend_name', undef),
449       san_ip                => hiera('cinder::backend::dellsc_iscsi::san_ip', undef),
450       san_login             => hiera('cinder::backend::dellsc_iscsi::san_login', undef),
451       san_password          => hiera('cinder::backend::dellsc_iscsi::san_password', undef),
452       dell_sc_ssn           => hiera('cinder::backend::dellsc_iscsi::dell_sc_ssn', undef),
453       iscsi_ip_address      => hiera('cinder::backend::dellsc_iscsi::iscsi_ip_address', undef),
454       iscsi_port            => hiera('cinder::backend::dellsc_iscsi::iscsi_port', undef),
455       dell_sc_api_port      => hiera('cinder::backend::dellsc_iscsi::dell_sc_api_port', undef),
456       dell_sc_server_folder => hiera('cinder::backend::dellsc_iscsi::dell_sc_server_folder', undef),
457       dell_sc_volume_folder => hiera('cinder::backend::dellsc_iscsi::dell_sc_volume_folder', undef),
458     }
459   }
460
461   if hiera('cinder_enable_netapp_backend', false) {
462     $cinder_netapp_backend = hiera('cinder::backend::netapp::title')
463
464     if hiera('cinder::backend::netapp::nfs_shares', undef) {
465       $cinder_netapp_nfs_shares = split(hiera('cinder::backend::netapp::nfs_shares', undef), ',')
466     }
467
468     cinder::backend::netapp { $cinder_netapp_backend :
469       netapp_login                 => hiera('cinder::backend::netapp::netapp_login', undef),
470       netapp_password              => hiera('cinder::backend::netapp::netapp_password', undef),
471       netapp_server_hostname       => hiera('cinder::backend::netapp::netapp_server_hostname', undef),
472       netapp_server_port           => hiera('cinder::backend::netapp::netapp_server_port', undef),
473       netapp_size_multiplier       => hiera('cinder::backend::netapp::netapp_size_multiplier', undef),
474       netapp_storage_family        => hiera('cinder::backend::netapp::netapp_storage_family', undef),
475       netapp_storage_protocol      => hiera('cinder::backend::netapp::netapp_storage_protocol', undef),
476       netapp_transport_type        => hiera('cinder::backend::netapp::netapp_transport_type', undef),
477       netapp_vfiler                => hiera('cinder::backend::netapp::netapp_vfiler', undef),
478       netapp_volume_list           => hiera('cinder::backend::netapp::netapp_volume_list', undef),
479       netapp_vserver               => hiera('cinder::backend::netapp::netapp_vserver', undef),
480       netapp_partner_backend_name  => hiera('cinder::backend::netapp::netapp_partner_backend_name', undef),
481       nfs_shares                   => $cinder_netapp_nfs_shares,
482       nfs_shares_config            => hiera('cinder::backend::netapp::nfs_shares_config', undef),
483       netapp_copyoffload_tool_path => hiera('cinder::backend::netapp::netapp_copyoffload_tool_path', undef),
484       netapp_controller_ips        => hiera('cinder::backend::netapp::netapp_controller_ips', undef),
485       netapp_sa_password           => hiera('cinder::backend::netapp::netapp_sa_password', undef),
486       netapp_storage_pools         => hiera('cinder::backend::netapp::netapp_storage_pools', undef),
487       netapp_eseries_host_type     => hiera('cinder::backend::netapp::netapp_eseries_host_type', undef),
488       netapp_webservice_path       => hiera('cinder::backend::netapp::netapp_webservice_path', undef),
489     }
490   }
491
492   if hiera('cinder_enable_nfs_backend', false) {
493     $cinder_nfs_backend = 'tripleo_nfs'
494
495     if str2bool($::selinux) {
496       selboolean { 'virt_use_nfs':
497         value      => on,
498         persistent => true,
499       } -> Package['nfs-utils']
500     }
501
502     package {'nfs-utils': } ->
503     cinder::backend::nfs { $cinder_nfs_backend :
504       nfs_servers       => hiera('cinder_nfs_servers'),
505       nfs_mount_options => hiera('cinder_nfs_mount_options',''),
506       nfs_shares_config => '/etc/cinder/shares-nfs.conf',
507     }
508   }
509
510   $cinder_enabled_backends = delete_undef_values([$cinder_iscsi_backend, $cinder_rbd_backend, $cinder_eqlx_backend, $cinder_dellsc_backend, $cinder_netapp_backend, $cinder_nfs_backend])
511   class { '::cinder::backends' :
512     enabled_backends => union($cinder_enabled_backends, hiera('cinder_user_enabled_backends')),
513   }
514
515   # swift proxy
516   include ::memcached
517   include ::swift::proxy
518   include ::swift::proxy::proxy_logging
519   include ::swift::proxy::healthcheck
520   include ::swift::proxy::cache
521   include ::swift::proxy::keystone
522   include ::swift::proxy::authtoken
523   include ::swift::proxy::staticweb
524   include ::swift::proxy::ratelimit
525   include ::swift::proxy::catch_errors
526   include ::swift::proxy::tempurl
527   include ::swift::proxy::formpost
528
529   # swift storage
530   if str2bool(hiera('enable_swift_storage', true)) {
531     class { '::swift::storage::all':
532       mount_check => str2bool(hiera('swift_mount_check')),
533     }
534     if(!defined(File['/srv/node'])) {
535       file { '/srv/node':
536         ensure  => directory,
537         owner   => 'swift',
538         group   => 'swift',
539         require => Package['openstack-swift'],
540       }
541     }
542     $swift_components = ['account', 'container', 'object']
543     swift::storage::filter::recon { $swift_components : }
544     swift::storage::filter::healthcheck { $swift_components : }
545   }
546
547   # Ceilometer
548   $ceilometer_backend = downcase(hiera('ceilometer_backend'))
549   case $ceilometer_backend {
550     /mysql/ : {
551       $ceilometer_database_connection = hiera('ceilometer_mysql_conn_string')
552     }
553     default : {
554       $ceilometer_database_connection = $ceilometer_mongodb_conn_string
555     }
556   }
557   include ::ceilometer
558   include ::ceilometer::config
559   include ::ceilometer::api
560   include ::ceilometer::agent::notification
561   include ::ceilometer::agent::central
562   include ::ceilometer::expirer
563   include ::ceilometer::collector
564   include ::ceilometer::agent::auth
565   class { '::ceilometer::db' :
566     database_connection => $ceilometer_database_connection,
567   }
568
569   Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
570
571   # Heat
572   class { '::heat' :
573     notification_driver => 'messaging',
574   }
575   include ::heat::config
576   include ::heat::api
577   include ::heat::api_cfn
578   include ::heat::api_cloudwatch
579   include ::heat::engine
580
581   # Sahara
582   include ::sahara
583   include ::sahara::service::api
584   include ::sahara::service::engine
585
586   # Horizon
587   if 'cisco_n1kv' in hiera('neutron::plugins::ml2::mechanism_drivers') {
588     $_profile_support = 'cisco'
589   } else {
590     $_profile_support = 'None'
591   }
592   $neutron_options   = {'profile_support' => $_profile_support }
593
594   class { '::horizon':
595     cache_server_ip => hiera('memcache_node_ips', '127.0.0.1'),
596     neutron_options => $neutron_options,
597   }
598
599   $snmpd_user = hiera('snmpd_readonly_user_name')
600   snmp::snmpv3_user { $snmpd_user:
601     authtype => 'MD5',
602     authpass => hiera('snmpd_readonly_user_password'),
603   }
604   class { '::snmp':
605     agentaddress => ['udp:161','udp6:[::1]:161'],
606     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' ],
607   }
608
609   hiera_include('controller_classes')
610
611 } #END STEP 3
612
613 if hiera('step') >= 4 {
614   $keystone_enable_db_purge = hiera('keystone_enable_db_purge', true)
615   $nova_enable_db_purge = hiera('nova_enable_db_purge', true)
616   $cinder_enable_db_purge = hiera('cinder_enable_db_purge', true)
617   $heat_enable_db_purge = hiera('heat_enable_db_purge', true)
618
619   if $keystone_enable_db_purge {
620     include ::keystone::cron::token_flush
621   }
622   if $nova_enable_db_purge {
623     include ::nova::cron::archive_deleted_rows
624   }
625   if $cinder_enable_db_purge {
626     include ::cinder::cron::db_purge
627   }
628   if $heat_enable_db_purge {
629     include ::heat::cron::purge_deleted
630   }
631 } #END STEP 4
632
633 $package_manifest_name = join(['/var/lib/tripleo/installed-packages/overcloud_controller', hiera('step')])
634 package_manifest{$package_manifest_name: ensure => present}