1 # Copyright 2014 Red Hat, Inc.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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
16 include ::tripleo::packages
17 include ::tripleo::firewall
19 $enable_load_balancer = hiera('enable_load_balancer', true)
21 if hiera('step') >= 1 {
23 create_resources(sysctl::value, hiera('sysctl_settings'), {})
25 $controller_node_ips = split(hiera('controller_node_ips'), ',')
27 if $enable_load_balancer {
28 class { '::tripleo::loadbalancer' :
29 controller_hosts => $controller_node_ips,
36 if hiera('step') >= 2 {
38 if count(hiera('ntp::servers')) > 0 {
43 if downcase(hiera('ceilometer_backend')) == 'mongodb' {
44 include ::mongodb::globals
46 include ::mongodb::server
47 $mongo_node_ips_with_port = suffix(hiera('mongo_node_ips'), ':27017')
48 $mongo_node_string = join($mongo_node_ips_with_port, ',')
50 $mongodb_replset = hiera('mongodb::server::replset')
51 $ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
52 if downcase(hiera('bootstrap_nodeid')) == $::hostname {
53 mongodb_replset { $mongodb_replset :
54 members => $mongo_node_ips_with_port,
60 $redis_node_ips = hiera('redis_node_ips')
61 $redis_master_hostname = downcase(hiera('bootstrap_nodeid'))
63 if $redis_master_hostname == $::hostname {
66 $slaveof = "${redis_master_hostname} 6379"
72 if count($redis_node_ips) > 1 {
73 Class['::tripleo::redis_notification'] -> Service['redis-sentinel']
74 include ::redis::sentinel
75 include ::tripleo::redis_notification
78 if str2bool(hiera('enable_galera', true)) {
79 $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
81 $mysql_config_file = '/etc/my.cnf.d/server.cnf'
84 class { '::mysql::server':
85 config_file => $mysql_config_file,
88 'bind-address' => hiera('mysql_bind_host'),
89 'max_connections' => hiera('mysql_max_connections'),
90 'open_files_limit' => '-1',
93 remove_default_accounts => true,
96 # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
97 # Create all the database schemas
98 include ::keystone::db::mysql
99 include ::glance::db::mysql
100 include ::nova::db::mysql
101 include ::neutron::db::mysql
102 include ::cinder::db::mysql
103 include ::heat::db::mysql
104 if downcase(hiera('ceilometer_backend')) == 'mysql' {
105 include ::ceilometer::db::mysql
108 $rabbit_nodes = hiera('rabbit_node_ips')
109 if count($rabbit_nodes) > 1 {
110 class { '::rabbitmq':
111 config_cluster => true,
112 cluster_nodes => $rabbit_nodes,
113 tcp_keepalive => false,
114 config_kernel_variables => hiera('rabbitmq_kernel_variables'),
115 config_variables => hiera('rabbitmq_config_variables'),
116 environment_variables => hiera('rabbitmq_environment'),
118 rabbitmq_policy { 'ha-all@/':
119 pattern => '^(?!amq\.).*',
128 # pre-install swift here so we can build rings
131 $enable_ceph = hiera('ceph_storage_count', 0) > 0
134 class { '::ceph::profile::params':
135 mon_initial_members => downcase(hiera('ceph_mon_initial_members')),
137 include ::ceph::profile::mon
140 if str2bool(hiera('enable_ceph_storage', false)) {
141 if str2bool(hiera('ceph_osd_selinux_permissive', true)) {
142 exec { 'set selinux to permissive on boot':
143 command => "sed -ie 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config",
144 onlyif => "test -f /etc/selinux/config && ! grep '^SELINUX=permissive' /etc/selinux/config",
145 path => ['/usr/bin', '/usr/sbin'],
148 exec { 'set selinux to permissive':
149 command => 'setenforce 0',
150 onlyif => "which setenforce && getenforce | grep -i 'enforcing'",
151 path => ['/usr/bin', '/usr/sbin'],
152 } -> Class['ceph::profile::osd']
155 include ::ceph::profile::osd
158 if str2bool(hiera('enable_external_ceph', false)) {
159 include ::ceph::profile::client
164 if hiera('step') >= 3 {
167 include ::keystone::roles::admin
168 include ::keystone::endpoint
170 #TODO: need a cleanup-keystone-tokens.sh solution here
172 'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
174 file { [ '/etc/keystone/ssl', '/etc/keystone/ssl/certs', '/etc/keystone/ssl/private' ]:
175 ensure => 'directory',
178 require => Package['keystone'],
180 file { '/etc/keystone/ssl/certs/signing_cert.pem':
181 content => hiera('keystone_signing_certificate'),
184 notify => Service['keystone'],
185 require => File['/etc/keystone/ssl/certs'],
187 file { '/etc/keystone/ssl/private/signing_key.pem':
188 content => hiera('keystone_signing_key'),
191 notify => Service['keystone'],
192 require => File['/etc/keystone/ssl/private'],
194 file { '/etc/keystone/ssl/certs/ca.pem':
195 content => hiera('keystone_ca_certificate'),
198 notify => Service['keystone'],
199 require => File['/etc/keystone/ssl/certs'],
202 $glance_backend = downcase(hiera('glance_backend', 'swift'))
203 case $glance_backend {
204 'swift': { $backend_store = 'glance.store.swift.Store' }
205 'file': { $backend_store = 'glance.store.filesystem.Store' }
206 'rbd': { $backend_store = 'glance.store.rbd.Store' }
207 default: { fail('Unrecognized glance_backend parameter.') }
209 $http_store = ['glance.store.http.Store']
210 $glance_store = concat($http_store, $backend_store)
212 # TODO: notifications, scrubber, etc.
214 class { '::glance::api':
215 known_stores => $glance_store,
217 include ::glance::registry
218 include join(['::glance::backend::', $glance_backend])
221 memcached_servers => suffix(hiera('memcache_node_ips'), ':11211'),
223 include ::nova::config
226 include ::nova::conductor
227 include ::nova::consoleauth
228 include ::nova::network::neutron
229 include ::nova::vncproxy
230 include ::nova::scheduler
231 include ::nova::scheduler::filter
234 include ::neutron::server
235 include ::neutron::server::notifications
237 # If the value of core plugin is set to 'nuage',
238 # include nuage core plugin,
239 # else use the default value of 'ml2'
240 if hiera('neutron::core_plugin') == 'neutron.plugins.nuage.plugin.NuagePlugin' {
241 include ::neutron::plugins::nuage
243 include ::neutron::agents::l3
244 include ::neutron::agents::dhcp
245 include ::neutron::agents::metadata
247 file { '/etc/neutron/dnsmasq-neutron.conf':
248 content => hiera('neutron_dnsmasq_options'),
251 notify => Service['neutron-dhcp-service'],
252 require => Package['neutron'],
255 class { '::neutron::plugins::ml2':
256 flat_networks => split(hiera('neutron_flat_networks'), ','),
257 tenant_network_types => [hiera('neutron_tenant_network_type')],
258 mechanism_drivers => [hiera('neutron_mechanism_drivers')],
260 class { '::neutron::agents::ml2::ovs':
261 bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
262 tunnel_types => split(hiera('neutron_tunnel_types'), ','),
264 if 'cisco_n1kv' in hiera('neutron_mechanism_drivers') {
265 include ::neutron::plugins::ml2::cisco::nexus1000v
267 class { '::neutron::agents::n1kv_vem':
268 n1kv_source => hiera('n1kv_vem_source', undef),
269 n1kv_version => hiera('n1kv_vem_version', undef),
273 n1kv_source => hiera('n1kv_vsm_source', undef),
274 n1kv_version => hiera('n1kv_vsm_version', undef),
275 pacemaker_control => false,
279 if 'cisco_ucsm' in hiera('neutron_mechanism_drivers') {
280 include ::neutron::plugins::ml2::cisco::ucsm
282 if 'cisco_nexus' in hiera('neutron_mechanism_drivers') {
283 include ::neutron::plugins::ml2::cisco::nexus
284 include ::neutron::plugins::ml2::cisco::type_nexus_vxlan
287 if hiera('neutron_enable_bigswitch_ml2', false) {
288 include ::neutron::plugins::ml2::bigswitch::restproxy
290 neutron_l3_agent_config {
291 'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
293 neutron_dhcp_agent_config {
294 'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
297 Service['neutron-server'] -> Service['neutron-dhcp-service']
298 Service['neutron-server'] -> Service['neutron-l3']
299 Service['neutron-server'] -> Service['neutron-ovs-agent-service']
300 Service['neutron-server'] -> Service['neutron-metadata']
304 include ::cinder::api
305 include ::cinder::glance
306 include ::cinder::scheduler
307 include ::cinder::volume
308 class { '::cinder::setup_test_volume':
309 size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
312 $cinder_enable_iscsi = hiera('cinder_enable_iscsi_backend', true)
313 if $cinder_enable_iscsi {
314 $cinder_iscsi_backend = 'tripleo_iscsi'
316 cinder::backend::iscsi { $cinder_iscsi_backend :
317 iscsi_ip_address => hiera('cinder_iscsi_ip_address'),
318 iscsi_helper => hiera('cinder_iscsi_helper'),
324 $ceph_pools = hiera('ceph_pools')
325 ceph::pool { $ceph_pools :
326 pg_num => hiera('ceph::profile::params::osd_pool_default_pg_num'),
327 pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'),
328 size => hiera('ceph::profile::params::osd_pool_default_size'),
331 $cinder_pool_requires = [Ceph::Pool[hiera('cinder_rbd_pool_name')]]
334 $cinder_pool_requires = []
337 if hiera('cinder_enable_rbd_backend', false) {
338 $cinder_rbd_backend = 'tripleo_ceph'
340 cinder::backend::rbd { $cinder_rbd_backend :
341 rbd_pool => hiera('cinder_rbd_pool_name'),
342 rbd_user => hiera('ceph_client_user_name'),
343 rbd_secret_uuid => hiera('ceph::profile::params::fsid'),
344 require => $cinder_pool_requires,
348 if hiera('cinder_enable_netapp_backend', false) {
349 $cinder_netapp_backend = hiera('cinder::backend::netapp::title')
352 "${cinder_netapp_backend}/host": value => 'hostgroup';
355 if hiera('cinder::backend::netapp::nfs_shares', undef) {
356 $cinder_netapp_nfs_shares = split(hiera('cinder::backend::netapp::nfs_shares', undef), ',')
359 cinder::backend::netapp { $cinder_netapp_backend :
360 netapp_login => hiera('cinder::backend::netapp::netapp_login', undef),
361 netapp_password => hiera('cinder::backend::netapp::netapp_password', undef),
362 netapp_server_hostname => hiera('cinder::backend::netapp::netapp_server_hostname', undef),
363 netapp_server_port => hiera('cinder::backend::netapp::netapp_server_port', undef),
364 netapp_size_multiplier => hiera('cinder::backend::netapp::netapp_size_multiplier', undef),
365 netapp_storage_family => hiera('cinder::backend::netapp::netapp_storage_family', undef),
366 netapp_storage_protocol => hiera('cinder::backend::netapp::netapp_storage_protocol', undef),
367 netapp_transport_type => hiera('cinder::backend::netapp::netapp_transport_type', undef),
368 netapp_vfiler => hiera('cinder::backend::netapp::netapp_vfiler', undef),
369 netapp_volume_list => hiera('cinder::backend::netapp::netapp_volume_list', undef),
370 netapp_vserver => hiera('cinder::backend::netapp::netapp_vserver', undef),
371 netapp_partner_backend_name => hiera('cinder::backend::netapp::netapp_partner_backend_name', undef),
372 nfs_shares => $cinder_netapp_nfs_shares,
373 nfs_shares_config => hiera('cinder::backend::netapp::nfs_shares_config', undef),
374 netapp_copyoffload_tool_path => hiera('cinder::backend::netapp::netapp_copyoffload_tool_path', undef),
375 netapp_controller_ips => hiera('cinder::backend::netapp::netapp_controller_ips', undef),
376 netapp_sa_password => hiera('cinder::backend::netapp::netapp_sa_password', undef),
377 netapp_storage_pools => hiera('cinder::backend::netapp::netapp_storage_pools', undef),
378 netapp_eseries_host_type => hiera('cinder::backend::netapp::netapp_eseries_host_type', undef),
379 netapp_webservice_path => hiera('cinder::backend::netapp::netapp_webservice_path', undef),
383 if hiera('cinder_enable_nfs_backend', false) {
384 $cinder_nfs_backend = 'tripleo_nfs'
386 if str2bool($::selinux) {
387 selboolean { 'virt_use_nfs':
390 } -> Package['nfs-utils']
393 package {'nfs-utils': } ->
394 cinder::backend::nfs { $cinder_nfs_backend :
395 nfs_servers => hiera('cinder_nfs_servers'),
396 nfs_mount_options => hiera('cinder_nfs_mount_options',''),
397 nfs_shares_config => '/etc/cinder/shares-nfs.conf',
401 $cinder_enabled_backends = delete_undef_values([$cinder_iscsi_backend, $cinder_rbd_backend, $cinder_netapp_backend, $cinder_nfs_backend])
402 class { '::cinder::backends' :
403 enabled_backends => $cinder_enabled_backends,
408 include ::swift::proxy
409 include ::swift::proxy::proxy_logging
410 include ::swift::proxy::healthcheck
411 include ::swift::proxy::cache
412 include ::swift::proxy::keystone
413 include ::swift::proxy::authtoken
414 include ::swift::proxy::staticweb
415 include ::swift::proxy::ratelimit
416 include ::swift::proxy::catch_errors
417 include ::swift::proxy::tempurl
418 include ::swift::proxy::formpost
421 if str2bool(hiera('enable_swift_storage', true)) {
422 class { '::swift::storage::all':
423 mount_check => str2bool(hiera('swift_mount_check')),
425 if(!defined(File['/srv/node'])) {
430 require => Package['openstack-swift'],
433 $swift_components = ['account', 'container', 'object']
434 swift::storage::filter::recon { $swift_components : }
435 swift::storage::filter::healthcheck { $swift_components : }
439 $ceilometer_backend = downcase(hiera('ceilometer_backend'))
440 case $ceilometer_backend {
442 $ceilometer_database_connection = hiera('ceilometer_mysql_conn_string')
445 $ceilometer_database_connection = $ceilometer_mongodb_conn_string
449 include ::ceilometer::config
450 include ::ceilometer::api
451 include ::ceilometer::agent::notification
452 include ::ceilometer::agent::central
453 include ::ceilometer::alarm::notifier
454 include ::ceilometer::alarm::evaluator
455 include ::ceilometer::expirer
456 include ::ceilometer::collector
457 include ::ceilometer::agent::auth
458 class { '::ceilometer::db' :
459 database_connection => $ceilometer_database_connection,
462 Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
467 include ::heat::api_cfn
468 include ::heat::api_cloudwatch
469 include ::heat::engine
472 if 'cisco_n1kv' in hiera('neutron_mechanism_drivers') {
473 $_profile_support = 'cisco'
475 $_profile_support = 'None'
477 $neutron_options = {'profile_support' => $_profile_support }
480 cache_server_ip => hiera('memcache_node_ips', '127.0.0.1'),
481 neutron_options => $neutron_options,
484 $snmpd_user = hiera('snmpd_readonly_user_name')
485 snmp::snmpv3_user { $snmpd_user:
487 authpass => hiera('snmpd_readonly_user_password'),
490 agentaddress => ['udp:161','udp6:[::1]:161'],
491 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' ],
494 hiera_include('controller_classes')
498 if hiera('step') >= 4 {
499 include ::keystone::cron::token_flush
502 $package_manifest_name = join(['/var/lib/tripleo/installed-packages/overcloud_controller', hiera('step')])
503 package_manifest{$package_manifest_name: ensure => present}