c1fb9fed94a8831c8c5dfa959a27222622f90426
[apex-tripleo-heat-templates.git] / puppet / manifests / overcloud_controller_pacemaker.pp
1 # Copyright 2015 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 Pcmk_resource <| |> {
17   tries     => 10,
18   try_sleep => 3,
19 }
20
21 if !str2bool(hiera('enable_package_install', 'false')) {
22   case $::osfamily {
23     'RedHat': {
24       Package { provider => 'norpm' } # provided by tripleo-puppet
25     }
26     default: {
27       warning('enable_package_install option not supported.')
28     }
29   }
30 }
31
32 if $::hostname == downcase(hiera('bootstrap_nodeid')) {
33   $pacemaker_master = true
34   $sync_db = true
35 } else {
36   $pacemaker_master = false
37   $sync_db = false
38 }
39
40 # When to start and enable services which haven't been Pacemakerized
41 # FIXME: change to only step 4 after this patch is merged:
42 # https://review.openstack.org/#/c/180565/
43 # $non_pcmk_start = hiera('step') >= 4
44 # FIXME: remove when we start all OpenStack services using Pacemaker
45 # (occurences of this variable will be gradually replaced with false)
46 $non_pcmk_start = hiera('step') >= 4 or (hiera('step') >= 3 and $pacemaker_master)
47
48 if hiera('step') >= 1 {
49
50   create_resources(sysctl::value, hiera('sysctl_settings'), {})
51
52   if count(hiera('ntp::servers')) > 0 {
53     include ::ntp
54   }
55
56   $controller_node_ips = split(hiera('controller_node_ips'), ',')
57   $controller_node_names = split(downcase(hiera('controller_node_names')), ',')
58   class { '::tripleo::loadbalancer' :
59     controller_hosts       => $controller_node_ips,
60     controller_hosts_names => $controller_node_names,
61     manage_vip             => false,
62     haproxy_service_manage => false,
63   }
64
65   $pacemaker_cluster_members = downcase(regsubst(hiera('controller_node_names'), ',', ' ', 'G'))
66   user { 'hacluster':
67    ensure => present,
68   } ->
69   class { '::pacemaker':
70     hacluster_pwd => hiera('hacluster_pwd'),
71   } ->
72   class { '::pacemaker::corosync':
73     cluster_members => $pacemaker_cluster_members,
74     setup_cluster   => $pacemaker_master,
75   }
76   class { '::pacemaker::stonith':
77     disable => true,
78   }
79
80   # Only configure RabbitMQ in this step, don't start it yet to
81   # avoid races where non-master nodes attempt to start without
82   # config (eg. binding on 0.0.0.0)
83   # The module ignores erlang_cookie if cluster_config is false
84   class { '::rabbitmq':
85     service_manage          => false,
86     tcp_keepalive           => false,
87     config_kernel_variables => hiera('rabbitmq_kernel_variables'),
88     config_variables        => hiera('rabbitmq_config_variables'),
89     environment_variables   => hiera('rabbitmq_environment'),
90   } ->
91   file { '/var/lib/rabbitmq/.erlang.cookie':
92     ensure  => 'present',
93     owner   => 'rabbitmq',
94     group   => 'rabbitmq',
95     mode    => '0400',
96     content => hiera('rabbitmq::erlang_cookie'),
97     replace => true,
98   }
99
100   # MongoDB
101   include ::mongodb::globals
102
103   # FIXME: replace with service_manage => false on ::mongodb::server
104   # when this is merged: https://github.com/puppetlabs/pupp etlabs-mongodb/pull/198
105   class { '::mongodb::server' :
106     service_ensure => undef,
107     service_enable => false,
108   }
109
110   # Galera
111   if str2bool(hiera('enable_galera', 'true')) {
112     $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
113   } else {
114     $mysql_config_file = '/etc/my.cnf.d/server.cnf'
115   }
116   $galera_nodes = downcase(hiera('galera_node_names', $::hostname))
117   $galera_nodes_count = count(split($galera_nodes, ','))
118
119   $mysqld_options = {
120     'mysqld' => {
121       'skip-name-resolve'             => '1',
122       'binlog_format'                 => 'ROW',
123       'default-storage-engine'        => 'innodb',
124       'innodb_autoinc_lock_mode'      => '2',
125       'innodb_locks_unsafe_for_binlog'=> '1',
126       'query_cache_size'              => '0',
127       'query_cache_type'              => '0',
128       'bind-address'                  => hiera('controller_host'),
129       'max_connections'               => '1024',
130       'open_files_limit'              => '-1',
131       'wsrep_provider'                => '/usr/lib64/galera/libgalera_smm.so',
132       'wsrep_cluster_name'            => 'galera_cluster',
133       'wsrep_slave_threads'           => '1',
134       'wsrep_certify_nonPK'           => '1',
135       'wsrep_max_ws_rows'             => '131072',
136       'wsrep_max_ws_size'             => '1073741824',
137       'wsrep_debug'                   => '0',
138       'wsrep_convert_LOCK_to_trx'     => '0',
139       'wsrep_retry_autocommit'        => '1',
140       'wsrep_auto_increment_control'  => '1',
141       'wsrep_drupal_282555_workaround'=> '0',
142       'wsrep_causal_reads'            => '0',
143       'wsrep_notify_cmd'              => '',
144       'wsrep_sst_method'              => 'rsync',
145     }
146   }
147
148   class { '::mysql::server':
149     create_root_user   => false,
150     create_root_my_cnf => false,
151     config_file        => $mysql_config_file,
152     override_options   => $mysqld_options,
153     service_manage     => false,
154   }
155
156 }
157
158 if hiera('step') >= 2 {
159
160   if $pacemaker_master {
161     $control_vip = hiera('tripleo::loadbalancer::controller_virtual_ip')
162     pacemaker::resource::ip { 'control_vip':
163       ip_address => $control_vip,
164     }
165     $public_vip = hiera('tripleo::loadbalancer::public_virtual_ip')
166     pacemaker::resource::ip { 'public_vip':
167       ip_address => $public_vip,
168     }
169     pacemaker::resource::service { 'haproxy':
170       clone_params => true,
171     }
172
173     pacemaker::resource::ocf { 'rabbitmq':
174       ocf_agent_name  => 'heartbeat:rabbitmq-cluster',
175       resource_params => 'set_policy=\'ha-all ^(?!amq\.).* {"ha-mode":"all"}\'',
176       clone_params    => 'ordered=true interleave=true',
177       require         => Class['::rabbitmq'],
178     }
179
180     if downcase(hiera('ceilometer_backend')) == 'mongodb' {
181       pacemaker::resource::service { $::mongodb::params::service_name :
182         op_params    => 'start timeout=120s',
183         clone_params => true,
184         require      => Class['::mongodb::server'],
185         before       => Exec['mongodb-ready'],
186       }
187       # NOTE (spredzy) : The replset can only be run
188       # once all the nodes have joined the cluster.
189       $mongo_node_ips = split(hiera('mongo_node_ips'), ',')
190       $mongo_node_ips_with_port = suffix($mongo_node_ips, ':27017')
191       $mongo_node_string = join($mongo_node_ips_with_port, ',')
192       $mongodb_replset = hiera('mongodb::server::replset')
193       $mongodb_cluster_ready_command = join(suffix(prefix($mongo_node_ips, '/bin/nc -w1 '), ' 27017 < /dev/null'), ' && ')
194       exec { 'mongodb-ready' :
195         command   => $mongodb_cluster_ready_command,
196         timeout   => 30,
197         tries     => 180,
198         try_sleep => 10,
199       }
200       mongodb_replset { $mongodb_replset :
201         members => $mongo_node_ips_with_port,
202         require => Exec['mongodb-ready'],
203       }
204     }
205
206     pacemaker::resource::ocf { 'galera' :
207       ocf_agent_name  => 'heartbeat:galera',
208       op_params       => 'promote timeout=300s on-fail=block --master',
209       meta_params     => "master-max=${galera_nodes_count} ordered=true",
210       resource_params => "additional_parameters='--open-files-limit=16384' enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}'",
211       require         => Class['::mysql::server'],
212       before          => Exec['galera-ready'],
213     }
214   }
215
216   # Redis
217   $redis_node_ips = split(hiera('redis_node_ips'), ',')
218   $redis_master_hostname = downcase(hiera('bootstrap_nodeid'))
219
220   if $redis_master_hostname == $::hostname {
221     $slaveof = undef
222   } else {
223     $slaveof = "${redis_master_hostname} 6379"
224   }
225   class {'::redis' :
226     slaveof => $slaveof,
227   }
228
229   if count($redis_node_ips) > 1 {
230     Class['::tripleo::redis_notification'] -> Service['redis-sentinel']
231     include ::redis::sentinel
232     class {'::tripleo::redis_notification' :
233       haproxy_monitor_ip => hiera('tripleo::loadbalancer::controller_virtual_ip'),
234     }
235   }
236
237   exec { 'galera-ready' :
238     command     => '/usr/bin/clustercheck >/dev/null',
239     timeout     => 30,
240     tries       => 180,
241     try_sleep   => 10,
242     environment => ["AVAILABLE_WHEN_READONLY=0"],
243     require     => File['/etc/sysconfig/clustercheck'],
244   }
245
246   file { '/etc/sysconfig/clustercheck' :
247     ensure  => file,
248     content => "MYSQL_USERNAME=root\n
249 MYSQL_PASSWORD=''\n
250 MYSQL_HOST=localhost\n",
251   }
252
253   xinetd::service { 'galera-monitor' :
254     port           => '9200',
255     server         => '/usr/bin/clustercheck',
256     per_source     => 'UNLIMITED',
257     log_on_success => '',
258     log_on_failure => 'HOST',
259     flags          => 'REUSE',
260     service_type   => 'UNLISTED',
261     user           => 'root',
262     group          => 'root',
263     require        => File['/etc/sysconfig/clustercheck'],
264   }
265
266   # Create all the database schemas
267   # Example DSN format: mysql://user:password@host/dbname
268   if $sync_db {
269     $allowed_hosts = ['%',hiera('controller_host')]
270     $keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
271     class { 'keystone::db::mysql':
272       user          => $keystone_dsn[3],
273       password      => $keystone_dsn[4],
274       host          => $keystone_dsn[5],
275       dbname        => $keystone_dsn[6],
276       allowed_hosts => $allowed_hosts,
277       require       => Exec['galera-ready'],
278     }
279     $glance_dsn = split(hiera('glance::api::database_connection'), '[@:/?]')
280     class { 'glance::db::mysql':
281       user          => $glance_dsn[3],
282       password      => $glance_dsn[4],
283       host          => $glance_dsn[5],
284       dbname        => $glance_dsn[6],
285       allowed_hosts => $allowed_hosts,
286       require       => Exec['galera-ready'],
287     }
288     $nova_dsn = split(hiera('nova::database_connection'), '[@:/?]')
289     class { 'nova::db::mysql':
290       user          => $nova_dsn[3],
291       password      => $nova_dsn[4],
292       host          => $nova_dsn[5],
293       dbname        => $nova_dsn[6],
294       allowed_hosts => $allowed_hosts,
295       require       => Exec['galera-ready'],
296     }
297     $neutron_dsn = split(hiera('neutron::server::database_connection'), '[@:/?]')
298     class { 'neutron::db::mysql':
299       user          => $neutron_dsn[3],
300       password      => $neutron_dsn[4],
301       host          => $neutron_dsn[5],
302       dbname        => $neutron_dsn[6],
303       allowed_hosts => $allowed_hosts,
304       require       => Exec['galera-ready'],
305     }
306     $cinder_dsn = split(hiera('cinder::database_connection'), '[@:/?]')
307     class { 'cinder::db::mysql':
308       user          => $cinder_dsn[3],
309       password      => $cinder_dsn[4],
310       host          => $cinder_dsn[5],
311       dbname        => $cinder_dsn[6],
312       allowed_hosts => $allowed_hosts,
313       require       => Exec['galera-ready'],
314     }
315     $heat_dsn = split(hiera('heat::database_connection'), '[@:/?]')
316     class { 'heat::db::mysql':
317       user          => $heat_dsn[3],
318       password      => $heat_dsn[4],
319       host          => $heat_dsn[5],
320       dbname        => $heat_dsn[6],
321       allowed_hosts => $allowed_hosts,
322       require       => Exec['galera-ready'],
323     }
324     if downcase(hiera('ceilometer_backend')) == 'mysql' {
325       $ceilometer_dsn = split(hiera('ceilometer_mysql_conn_string'), '[@:/?]')
326       class { 'ceilometer::db::mysql':
327         user          => $ceilometer_dsn[3],
328         password      => $ceilometer_dsn[4],
329         host          => $ceilometer_dsn[5],
330         dbname        => $ceilometer_dsn[6],
331         allowed_hosts => $allowed_hosts,
332         require       => Exec['galera-ready'],
333       }
334     }
335   }
336
337   # pre-install swift here so we can build rings
338   include ::swift
339
340   # Ceph
341   $cinder_enable_rbd_backend = hiera('cinder_enable_rbd_backend', false)
342   $enable_ceph = $cinder_enable_rbd_backend
343
344   if $enable_ceph {
345     class { 'ceph::profile::params':
346       mon_initial_members => downcase(hiera('ceph_mon_initial_members'))
347     }
348     include ::ceph::profile::mon
349   }
350
351   if str2bool(hiera('enable_ceph_storage', 'false')) {
352     include ::ceph::profile::client
353     include ::ceph::profile::osd
354   }
355
356   # Memcached
357   include ::memcached
358
359 } #END STEP 2
360
361 if hiera('step') >= 3 {
362
363   class { '::keystone':
364     sync_db => $sync_db,
365     manage_service => $non_pcmk_start,
366     enabled => $non_pcmk_start,
367   }
368
369   #TODO: need a cleanup-keystone-tokens.sh solution here
370   keystone_config {
371     'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
372   }
373   file { [ '/etc/keystone/ssl', '/etc/keystone/ssl/certs', '/etc/keystone/ssl/private' ]:
374     ensure  => 'directory',
375     owner   => 'keystone',
376     group   => 'keystone',
377     require => Package['keystone'],
378   }
379   file { '/etc/keystone/ssl/certs/signing_cert.pem':
380     content => hiera('keystone_signing_certificate'),
381     owner   => 'keystone',
382     group   => 'keystone',
383     notify  => Service['keystone'],
384     require => File['/etc/keystone/ssl/certs'],
385   }
386   file { '/etc/keystone/ssl/private/signing_key.pem':
387     content => hiera('keystone_signing_key'),
388     owner   => 'keystone',
389     group   => 'keystone',
390     notify  => Service['keystone'],
391     require => File['/etc/keystone/ssl/private'],
392   }
393   file { '/etc/keystone/ssl/certs/ca.pem':
394     content => hiera('keystone_ca_certificate'),
395     owner   => 'keystone',
396     group   => 'keystone',
397     notify  => Service['keystone'],
398     require => File['/etc/keystone/ssl/certs'],
399   }
400
401   $glance_backend = downcase(hiera('glance_backend', 'swift'))
402   case $glance_backend {
403       swift: { $glance_store = 'glance.store.swift.Store' }
404       file: { $glance_store = 'glance.store.filesystem.Store' }
405       rbd: { $glance_store = 'glance.store.rbd.Store' }
406       default: { fail('Unrecognized glance_backend parameter.') }
407   }
408
409   # TODO: notifications, scrubber, etc.
410   include ::glance
411   class { 'glance::api':
412     known_stores => [$glance_store],
413     manage_service => $non_pcmk_start,
414     enabled => $non_pcmk_start,
415   }
416   class { '::glance::registry' :
417     sync_db => $sync_db,
418     manage_service => $non_pcmk_start,
419     enabled => $non_pcmk_start,
420   }
421   include join(['::glance::backend::', $glance_backend])
422
423   class { 'nova':
424     glance_api_servers     => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
425   }
426
427   class { '::nova::api' :
428     sync_db => $sync_db,
429     manage_service => $non_pcmk_start,
430     enabled => $non_pcmk_start,
431   }
432   class { '::nova::cert' :
433     manage_service => $non_pcmk_start,
434     enabled => $non_pcmk_start,
435   }
436   class { '::nova::conductor' :
437     manage_service => $non_pcmk_start,
438     enabled => $non_pcmk_start,
439   }
440   class { '::nova::consoleauth' :
441     manage_service => $non_pcmk_start,
442     enabled => $non_pcmk_start,
443   }
444   class { '::nova::vncproxy' :
445     manage_service => $non_pcmk_start,
446     enabled => $non_pcmk_start,
447   }
448   class { '::nova::scheduler' :
449     manage_service => $non_pcmk_start,
450     enabled => $non_pcmk_start,
451   }
452   include ::nova::network::neutron
453
454   include ::neutron
455   class { '::neutron::server' :
456     sync_db => $sync_db,
457     manage_service => $non_pcmk_start,
458     enabled => $non_pcmk_start,
459   }
460   class { '::neutron::agents::dhcp' :
461     manage_service => $non_pcmk_start,
462     enabled => $non_pcmk_start,
463   }
464   class { '::neutron::agents::l3' :
465     manage_service => $non_pcmk_start,
466     enabled => $non_pcmk_start,
467   }
468
469   file { '/etc/neutron/dnsmasq-neutron.conf':
470     content => hiera('neutron_dnsmasq_options'),
471     owner   => 'neutron',
472     group   => 'neutron',
473     notify  => Service['neutron-dhcp-service'],
474     require => Package['neutron'],
475   }
476
477   class { 'neutron::plugins::ml2':
478     flat_networks        => split(hiera('neutron_flat_networks'), ','),
479     tenant_network_types => [hiera('neutron_tenant_network_type')],
480     type_drivers         => [hiera('neutron_tenant_network_type')],
481   }
482
483   class { 'neutron::agents::ml2::ovs':
484     # manage_service   => $non_pcmk_start,  -- not implemented
485     enabled          => $non_pcmk_start,
486     bridge_mappings  => split(hiera('neutron_bridge_mappings'), ','),
487     tunnel_types     => split(hiera('neutron_tunnel_types'), ','),
488   }
489
490   class { 'neutron::agents::metadata':
491     manage_service   => $non_pcmk_start,
492     enabled          => $non_pcmk_start,
493     auth_url => join(['http://', hiera('controller_virtual_ip'), ':35357/v2.0']),
494   }
495
496   Service['neutron-server'] -> Service['neutron-dhcp-service']
497   Service['neutron-server'] -> Service['neutron-l3']
498   Service['neutron-server'] -> Service['neutron-ovs-agent-service']
499   Service['neutron-server'] -> Service['neutron-metadata']
500
501   include ::cinder
502   class { '::cinder::api':
503     sync_db => $sync_db,
504     manage_service => $non_pcmk_start,
505     enabled => $non_pcmk_start,
506   }
507   class { '::cinder::scheduler' :
508     manage_service => $non_pcmk_start,
509     enabled => $non_pcmk_start,
510   }
511   class { '::cinder::volume' :
512     manage_service => $non_pcmk_start,
513     enabled => $non_pcmk_start,
514   }
515   include ::cinder::glance
516   class {'cinder::setup_test_volume':
517     size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
518   }
519
520   $cinder_enable_iscsi = hiera('cinder_enable_iscsi_backend', true)
521   if $cinder_enable_iscsi {
522     $cinder_iscsi_backend = 'tripleo_iscsi'
523
524     cinder::backend::iscsi { $cinder_iscsi_backend :
525       iscsi_ip_address => hiera('cinder_iscsi_ip_address'),
526       iscsi_helper     => hiera('cinder_iscsi_helper'),
527     }
528   }
529
530   if $enable_ceph {
531
532     Ceph_pool {
533       pg_num  => hiera('ceph::profile::params::osd_pool_default_pg_num'),
534       pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'),
535       size    => hiera('ceph::profile::params::osd_pool_default_size'),
536     }
537
538     $ceph_pools = hiera('ceph_pools')
539     ceph::pool { $ceph_pools : }
540   }
541
542   if $cinder_enable_rbd_backend {
543     $cinder_rbd_backend = 'tripleo_ceph'
544
545     cinder_config {
546       "${cinder_rbd_backend}/host": value => 'hostgroup';
547     }
548
549     cinder::backend::rbd { $cinder_rbd_backend :
550       rbd_pool        => 'volumes',
551       rbd_user        => 'openstack',
552       rbd_secret_uuid => hiera('ceph::profile::params::fsid'),
553       require         => Ceph::Pool['volumes'],
554     }
555   }
556
557   $cinder_enabled_backends = delete_undef_values([$cinder_iscsi_backend, $cinder_rbd_backend])
558   class { '::cinder::backends' :
559     enabled_backends => $cinder_enabled_backends,
560   }
561
562   # swift proxy
563   class { '::swift::proxy' :
564     manage_service => $non_pcmk_start,
565     enabled => $non_pcmk_start,
566   }
567   include ::swift::proxy::proxy_logging
568   include ::swift::proxy::healthcheck
569   include ::swift::proxy::cache
570   include ::swift::proxy::keystone
571   include ::swift::proxy::authtoken
572   include ::swift::proxy::staticweb
573   include ::swift::proxy::ceilometer
574   include ::swift::proxy::ratelimit
575   include ::swift::proxy::catch_errors
576   include ::swift::proxy::tempurl
577   include ::swift::proxy::formpost
578
579   # swift storage
580   if str2bool(hiera('enable_swift_storage', 'true')) {
581     class {'::swift::storage::all':
582       mount_check => str2bool(hiera('swift_mount_check'))
583     }
584     class {'::swift::storage::account':
585       manage_service => $non_pcmk_start,
586       enabled => $non_pcmk_start,
587     }
588     class {'::swift::storage::container':
589       manage_service => $non_pcmk_start,
590       enabled => $non_pcmk_start,
591     }
592     class {'::swift::storage::object':
593       manage_service => $non_pcmk_start,
594       enabled => $non_pcmk_start,
595     }
596     if(!defined(File['/srv/node'])) {
597       file { '/srv/node':
598         ensure  => directory,
599         owner   => 'swift',
600         group   => 'swift',
601         require => Package['openstack-swift'],
602       }
603     }
604     $swift_components = ['account', 'container', 'object']
605     swift::storage::filter::recon { $swift_components : }
606     swift::storage::filter::healthcheck { $swift_components : }
607   }
608
609   # Ceilometer
610   $ceilometer_backend = downcase(hiera('ceilometer_backend'))
611   case $ceilometer_backend {
612     /mysql/ : {
613       $ceilometer_database_connection = hiera('ceilometer_mysql_conn_string')
614     }
615     default : {
616       $ceilometer_database_connection = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
617     }
618   }
619   include ::ceilometer
620   class { '::ceilometer::api' :
621     manage_service => $non_pcmk_start,
622     enabled => $non_pcmk_start,
623   }
624   class { '::ceilometer::agent::notification' :
625     manage_service => $non_pcmk_start,
626     enabled => $non_pcmk_start,
627   }
628   class { '::ceilometer::agent::central' :
629     manage_service => $non_pcmk_start,
630     enabled => $non_pcmk_start,
631   }
632   class { '::ceilometer::alarm::notifier' :
633     manage_service => $non_pcmk_start,
634     enabled => $non_pcmk_start,
635   }
636   class { '::ceilometer::alarm::evaluator' :
637     manage_service => $non_pcmk_start,
638     enabled => $non_pcmk_start,
639   }
640   class { '::ceilometer::collector' :
641     manage_service => $non_pcmk_start,
642     enabled => $non_pcmk_start,
643   }
644   include ::ceilometer::expirer
645   class { '::ceilometer::db' :
646     database_connection => $ceilometer_database_connection,
647     sync_db             => $sync_db,
648   }
649   class { 'ceilometer::agent::auth':
650     auth_url => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
651   }
652
653   Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
654
655   # Heat
656   class { '::heat' :
657     sync_db => $sync_db,
658   }
659   class { '::heat::api' :
660     manage_service => $non_pcmk_start,
661     enabled => $non_pcmk_start,
662   }
663   class { '::heat::api_cfn' :
664     manage_service => $non_pcmk_start,
665     enabled => $non_pcmk_start,
666   }
667   class { '::heat::api_cloudwatch' :
668     manage_service => $non_pcmk_start,
669     enabled => $non_pcmk_start,
670   }
671   class { '::heat::engine' :
672     manage_service => $non_pcmk_start,
673     enabled => $non_pcmk_start,
674   }
675
676   # Horizon
677   $vhost_params = { add_listen => false }
678   class { 'horizon':
679     cache_server_ip    => split(hiera('memcache_node_ips', '127.0.0.1'), ','),
680     vhost_extra_params => $vhost_params,
681   }
682
683   $snmpd_user = hiera('snmpd_readonly_user_name')
684   snmp::snmpv3_user { $snmpd_user:
685     authtype => 'MD5',
686     authpass => hiera('snmpd_readonly_user_password'),
687   }
688   class { 'snmp':
689     agentaddress => ['udp:161','udp6:[::1]:161'],
690     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' ],
691   }
692
693 } #END STEP 3
694
695 if hiera('step') >= 4 {
696   # TODO: pacemaker::resource::service for OpenStack services go here
697 } #END STEP 4