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
18 if hiera('step') >= 1 {
20 create_resources(sysctl::value, hiera('sysctl_settings'), {})
22 $controller_node_ips = split(hiera('controller_node_ips'), ',')
24 class { '::tripleo::loadbalancer' :
25 controller_hosts => $controller_node_ips,
31 if hiera('step') >= 2 {
33 if count(hiera('ntp::servers')) > 0 {
38 if downcase(hiera('ceilometer_backend')) == 'mongodb' {
39 include ::mongodb::globals
41 include ::mongodb::server
42 $mongo_node_ips_with_port = suffix(hiera('mongo_node_ips'), ':27017')
43 $mongo_node_string = join($mongo_node_ips_with_port, ',')
45 $mongodb_replset = hiera('mongodb::server::replset')
46 $ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
47 if downcase(hiera('bootstrap_nodeid')) == $::hostname {
48 mongodb_replset { $mongodb_replset :
49 members => $mongo_node_ips_with_port,
55 $redis_node_ips = hiera('redis_node_ips')
56 $redis_master_hostname = downcase(hiera('bootstrap_nodeid'))
58 if $redis_master_hostname == $::hostname {
61 $slaveof = "${redis_master_hostname} 6379"
67 if count($redis_node_ips) > 1 {
68 Class['::tripleo::redis_notification'] -> Service['redis-sentinel']
69 include ::redis::sentinel
70 include ::tripleo::redis_notification
73 if str2bool(hiera('enable_galera', 'true')) {
74 $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
76 $mysql_config_file = '/etc/my.cnf.d/server.cnf'
79 class { 'mysql::server':
80 config_file => $mysql_config_file,
83 'bind-address' => hiera('mysql_bind_host'),
84 'max_connections' => hiera('mysql_max_connections'),
85 'open_files_limit' => '-1',
90 # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
91 # Create all the database schemas
92 include ::keystone::db::mysql
93 include ::glance::db::mysql
94 include ::nova::db::mysql
95 include ::neutron::db::mysql
96 include ::cinder::db::mysql
97 include ::heat::db::mysql
98 if downcase(hiera('ceilometer_backend')) == 'mysql' {
99 include ::ceilometer::db::mysql
102 $rabbit_nodes = hiera('rabbit_node_ips')
103 if count($rabbit_nodes) > 1 {
104 class { '::rabbitmq':
105 config_cluster => true,
106 cluster_nodes => $rabbit_nodes,
107 tcp_keepalive => false,
108 config_kernel_variables => hiera('rabbitmq_kernel_variables'),
109 config_variables => hiera('rabbitmq_config_variables'),
110 environment_variables => hiera('rabbitmq_environment'),
112 rabbitmq_policy { 'ha-all@/':
113 pattern => '^(?!amq\.).*',
122 # pre-install swift here so we can build rings
125 $cinder_enable_rbd_backend = hiera('cinder_enable_rbd_backend', false)
126 $enable_ceph = $cinder_enable_rbd_backend
129 class { 'ceph::profile::params':
130 mon_initial_members => downcase(hiera('ceph_mon_initial_members'))
132 include ::ceph::profile::mon
135 if str2bool(hiera('enable_ceph_storage', 'false')) {
136 include ::ceph::profile::client
137 include ::ceph::profile::osd
142 if hiera('step') >= 3 {
146 #TODO: need a cleanup-keystone-tokens.sh solution here
148 'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
150 file { [ '/etc/keystone/ssl', '/etc/keystone/ssl/certs', '/etc/keystone/ssl/private' ]:
151 ensure => 'directory',
154 require => Package['keystone'],
156 file { '/etc/keystone/ssl/certs/signing_cert.pem':
157 content => hiera('keystone_signing_certificate'),
160 notify => Service['keystone'],
161 require => File['/etc/keystone/ssl/certs'],
163 file { '/etc/keystone/ssl/private/signing_key.pem':
164 content => hiera('keystone_signing_key'),
167 notify => Service['keystone'],
168 require => File['/etc/keystone/ssl/private'],
170 file { '/etc/keystone/ssl/certs/ca.pem':
171 content => hiera('keystone_ca_certificate'),
174 notify => Service['keystone'],
175 require => File['/etc/keystone/ssl/certs'],
178 $glance_backend = downcase(hiera('glance_backend', 'swift'))
179 case $glance_backend {
180 swift: { $backend_store = 'glance.store.swift.Store' }
181 file: { $backend_store = 'glance.store.filesystem.Store' }
182 rbd: { $backend_store = 'glance.store.rbd.Store' }
183 default: { fail('Unrecognized glance_backend parameter.') }
185 $http_store = ['glance.store.http.Store']
186 $glance_store = concat($http_store, $backend_store)
188 # TODO: notifications, scrubber, etc.
190 class { 'glance::api':
191 known_stores => $glance_store
193 include ::glance::registry
194 include join(['::glance::backend::', $glance_backend])
199 include ::nova::conductor
200 include ::nova::consoleauth
201 include ::nova::network::neutron
202 include ::nova::vncproxy
203 include ::nova::scheduler
206 include ::neutron::server
207 include ::neutron::agents::l3
208 include ::neutron::agents::dhcp
209 include ::neutron::agents::metadata
211 file { '/etc/neutron/dnsmasq-neutron.conf':
212 content => hiera('neutron_dnsmasq_options'),
215 notify => Service['neutron-dhcp-service'],
216 require => Package['neutron'],
219 class { 'neutron::plugins::ml2':
220 flat_networks => split(hiera('neutron_flat_networks'), ','),
221 tenant_network_types => [hiera('neutron_tenant_network_type')],
223 class { 'neutron::agents::ml2::ovs':
224 bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
225 tunnel_types => split(hiera('neutron_tunnel_types'), ','),
228 Service['neutron-server'] -> Service['neutron-dhcp-service']
229 Service['neutron-server'] -> Service['neutron-l3']
230 Service['neutron-server'] -> Service['neutron-ovs-agent-service']
231 Service['neutron-server'] -> Service['neutron-metadata']
234 include ::cinder::api
235 include ::cinder::glance
236 include ::cinder::scheduler
237 include ::cinder::volume
238 class {'cinder::setup_test_volume':
239 size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
242 $cinder_enable_iscsi = hiera('cinder_enable_iscsi_backend', true)
243 if $cinder_enable_iscsi {
244 $cinder_iscsi_backend = 'tripleo_iscsi'
246 cinder::backend::iscsi { $cinder_iscsi_backend :
247 iscsi_ip_address => hiera('cinder_iscsi_ip_address'),
248 iscsi_helper => hiera('cinder_iscsi_helper'),
255 pg_num => hiera('ceph::profile::params::osd_pool_default_pg_num'),
256 pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'),
257 size => hiera('ceph::profile::params::osd_pool_default_size'),
260 $ceph_pools = hiera('ceph_pools')
261 ceph::pool { $ceph_pools : }
264 if $cinder_enable_rbd_backend {
265 $cinder_rbd_backend = 'tripleo_ceph'
268 "${cinder_rbd_backend}/host": value => 'hostgroup';
271 cinder::backend::rbd { $cinder_rbd_backend :
272 rbd_pool => 'volumes',
273 rbd_user => 'openstack',
274 rbd_secret_uuid => hiera('ceph::profile::params::fsid'),
275 require => Ceph::Pool['volumes'],
279 if hiera('cinder_enable_netapp_backend', false) {
280 $cinder_netapp_backend = hiera('cinder::backend::netapp::title')
283 "${cinder_netapp_backend}/host": value => 'hostgroup';
286 if hiera('cinder::backend::netapp::nfs_shares', undef) {
287 $cinder_netapp_nfs_shares = split(hiera('cinder::backend::netapp::nfs_shares', undef), ',')
290 cinder::backend::netapp { $cinder_netapp_backend :
291 netapp_login => hiera('cinder::backend::netapp::netapp_login', undef),
292 netapp_password => hiera('cinder::backend::netapp::netapp_password', undef),
293 netapp_server_hostname => hiera('cinder::backend::netapp::netapp_server_hostname', undef),
294 netapp_server_port => hiera('cinder::backend::netapp::netapp_server_port', undef),
295 netapp_size_multiplier => hiera('cinder::backend::netapp::netapp_size_multiplier', undef),
296 netapp_storage_family => hiera('cinder::backend::netapp::netapp_storage_family', undef),
297 netapp_storage_protocol => hiera('cinder::backend::netapp::netapp_storage_protocol', undef),
298 netapp_transport_type => hiera('cinder::backend::netapp::netapp_transport_type', undef),
299 netapp_vfiler => hiera('cinder::backend::netapp::netapp_vfiler', undef),
300 netapp_volume_list => hiera('cinder::backend::netapp::netapp_volume_list', undef),
301 netapp_vserver => hiera('cinder::backend::netapp::netapp_vserver', undef),
302 netapp_partner_backend_name => hiera('cinder::backend::netapp::netapp_partner_backend_name', undef),
303 nfs_shares => $cinder_netapp_nfs_shares,
304 nfs_shares_config => hiera('cinder::backend::netapp::nfs_shares_config', undef),
305 netapp_copyoffload_tool_path => hiera('cinder::backend::netapp::netapp_copyoffload_tool_path', undef),
306 netapp_controller_ips => hiera('cinder::backend::netapp::netapp_controller_ips', undef),
307 netapp_sa_password => hiera('cinder::backend::netapp::netapp_sa_password', undef),
308 netapp_storage_pools => hiera('cinder::backend::netapp::netapp_storage_pools', undef),
309 netapp_eseries_host_type => hiera('cinder::backend::netapp::netapp_eseries_host_type', undef),
310 netapp_webservice_path => hiera('cinder::backend::netapp::netapp_webservice_path', undef),
314 $cinder_enabled_backends = delete_undef_values([$cinder_iscsi_backend, $cinder_rbd_backend, $cinder_netapp_backend])
315 class { '::cinder::backends' :
316 enabled_backends => $cinder_enabled_backends,
321 include ::swift::proxy
322 include ::swift::proxy::proxy_logging
323 include ::swift::proxy::healthcheck
324 include ::swift::proxy::cache
325 include ::swift::proxy::keystone
326 include ::swift::proxy::authtoken
327 include ::swift::proxy::staticweb
328 include ::swift::proxy::ratelimit
329 include ::swift::proxy::catch_errors
330 include ::swift::proxy::tempurl
331 include ::swift::proxy::formpost
334 if str2bool(hiera('enable_swift_storage', 'true')) {
335 class {'swift::storage::all':
336 mount_check => str2bool(hiera('swift_mount_check'))
338 if(!defined(File['/srv/node'])) {
343 require => Package['openstack-swift'],
346 $swift_components = ['account', 'container', 'object']
347 swift::storage::filter::recon { $swift_components : }
348 swift::storage::filter::healthcheck { $swift_components : }
352 $ceilometer_backend = downcase(hiera('ceilometer_backend'))
353 case $ceilometer_backend {
355 $ceilometer_database_connection = hiera('ceilometer_mysql_conn_string')
358 $ceilometer_database_connection = $ceilometer_mongodb_conn_string
362 include ::ceilometer::api
363 include ::ceilometer::agent::notification
364 include ::ceilometer::agent::central
365 include ::ceilometer::alarm::notifier
366 include ::ceilometer::alarm::evaluator
367 include ::ceilometer::expirer
368 include ::ceilometer::collector
369 include ceilometer::agent::auth
370 class { '::ceilometer::db' :
371 database_connection => $ceilometer_database_connection,
374 Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
379 include ::heat::api_cfn
380 include ::heat::api_cloudwatch
381 include ::heat::engine
384 $vhost_params = { add_listen => false }
386 cache_server_ip => hiera('memcache_node_ips', '127.0.0.1'),
387 vhost_extra_params => $vhost_params,
390 $snmpd_user = hiera('snmpd_readonly_user_name')
391 snmp::snmpv3_user { $snmpd_user:
393 authpass => hiera('snmpd_readonly_user_password'),
396 agentaddress => ['udp:161','udp6:[::1]:161'],
397 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' ],
400 hiera_include('controller_classes')