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 if !str2bool(hiera('enable_package_install', 'false')) {
19 Package { provider => 'norpm' } # provided by tripleo-puppet
22 warning('enable_package_install option not supported.')
27 if hiera('step') >= 1 {
29 $controller_node_ips = split(downcase(hiera('controller_node_ips')), ',')
30 class { '::tripleo::loadbalancer' :
31 controller_hosts => $controller_node_ips,
36 if hiera('step') >= 2 {
38 if count(hiera('ntp::servers')) > 0 {
43 class { 'mysql::server':
46 'bind-address' => hiera('controller_host')
51 # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
52 # Create all the database schemas
53 # Example DSN format: mysql://user:password@host/dbname
54 $allowed_hosts = ['%',hiera('controller_host')]
55 $keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
56 class { 'keystone::db::mysql':
57 user => $keystone_dsn[3],
58 password => $keystone_dsn[4],
59 host => $keystone_dsn[5],
60 dbname => $keystone_dsn[6],
61 allowed_hosts => $allowed_hosts,
63 $glance_dsn = split(hiera('glance::api::database_connection'), '[@:/?]')
64 class { 'glance::db::mysql':
65 user => $glance_dsn[3],
66 password => $glance_dsn[4],
67 host => $glance_dsn[5],
68 dbname => $glance_dsn[6],
69 allowed_hosts => $allowed_hosts,
71 $nova_dsn = split(hiera('nova::database_connection'), '[@:/?]')
72 class { 'nova::db::mysql':
74 password => $nova_dsn[4],
76 dbname => $nova_dsn[6],
77 allowed_hosts => $allowed_hosts,
79 $neutron_dsn = split(hiera('neutron::server::database_connection'), '[@:/?]')
80 class { 'neutron::db::mysql':
81 user => $neutron_dsn[3],
82 password => $neutron_dsn[4],
83 host => $neutron_dsn[5],
84 dbname => $neutron_dsn[6],
85 allowed_hosts => $allowed_hosts,
87 $cinder_dsn = split(hiera('cinder::database_connection'), '[@:/?]')
88 class { 'cinder::db::mysql':
89 user => $cinder_dsn[3],
90 password => $cinder_dsn[4],
91 host => $cinder_dsn[5],
92 dbname => $cinder_dsn[6],
93 allowed_hosts => $allowed_hosts,
95 $heat_dsn = split(hiera('heat::database_connection'), '[@:/?]')
96 class { 'heat::db::mysql':
98 password => $heat_dsn[4],
100 dbname => $heat_dsn[6],
101 allowed_hosts => $allowed_hosts,
103 $ceilometer_dsn = split(hiera('ceilometer::db::database_connection'), '[@:/?]')
104 class { 'ceilometer::db::mysql':
105 user => $ceilometer_dsn[3],
106 password => $ceilometer_dsn[4],
107 host => $ceilometer_dsn[5],
108 dbname => $ceilometer_dsn[6],
109 allowed_hosts => $allowed_hosts,
112 Class['rabbitmq'] -> Rabbitmq_vhost <| |>
113 Class['rabbitmq'] -> Rabbitmq_user <| |>
114 Class['rabbitmq'] -> Rabbitmq_user_permissions <| |>
116 $rabbit_nodes = split(downcase(hiera('rabbit_node_names', $::hostname)), ',')
117 if count($rabbit_nodes) > 1 {
118 $rabbit_cluster = true
121 $rabbit_cluster = false
124 config_cluster => $rabbit_cluster,
125 cluster_nodes => $rabbit_nodes,
126 node_ip_address => hiera('controller_host'),
129 rabbitmq_policy { 'ha-all@/':
130 pattern => '^(?!amq\.).*',
133 'ha-sync-mode' => 'automatic',
137 rabbitmq_vhost { '/':
138 provider => 'rabbitmqctl',
141 # pre-install swift here so we can build rings
144 $cinder_enable_rbd_backend = hiera('cinder_enable_rbd_backend', false)
145 $enable_ceph = $cinder_enable_rbd_backend
148 class { 'ceph::profile::params':
149 mon_initial_members => downcase(hiera('ceph_mon_initial_members'))
151 include ::ceph::profile::mon
154 if $cinder_enable_rbd_backend {
155 ceph::key { 'client.openstack' :
156 secret => hiera('ceph::profile::params::mon_key'),
157 cap_mon => hiera('ceph_openstack_default_cap_mon'),
158 cap_osd => hiera('ceph_openstack_default_cap_osd'),
166 if hiera('step') >= 3 {
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 # TODO: notifications, scrubber, etc.
203 include ::glance::api
204 include ::glance::registry
205 include ::glance::backend::swift
208 glance_api_servers => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
213 include ::nova::conductor
214 include ::nova::consoleauth
215 include ::nova::network::neutron
216 include ::nova::vncproxy
217 include ::nova::scheduler
220 include ::neutron::server
221 include ::neutron::agents::dhcp
222 include ::neutron::agents::l3
224 file { '/etc/neutron/dnsmasq-neutron.conf':
225 content => hiera('neutron_dnsmasq_options'),
228 notify => Service['neutron-dhcp-service'],
229 require => Package['neutron'],
232 class { 'neutron::plugins::ml2':
233 flat_networks => split(hiera('neutron_flat_networks'), ','),
234 tenant_network_types => [hiera('neutron_tenant_network_type')],
235 type_drivers => [hiera('neutron_tenant_network_type')],
238 class { 'neutron::agents::ml2::ovs':
239 bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
240 tunnel_types => split(hiera('neutron_tunnel_types'), ','),
243 class { 'neutron::agents::metadata':
244 auth_url => join(['http://', hiera('controller_virtual_ip'), ':35357/v2.0']),
247 Service['neutron-server'] -> Service['neutron-dhcp-service']
248 Service['neutron-server'] -> Service['neutron-l3']
249 Service['neutron-server'] -> Service['neutron-ovs-agent-service']
250 Service['neutron-server'] -> Service['neutron-metadata']
253 include ::cinder::api
254 include ::cinder::glance
255 include ::cinder::scheduler
256 include ::cinder::volume
257 class {'cinder::setup_test_volume':
258 size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
261 $cinder_enable_iscsi = hiera('cinder_enable_iscsi_backend', true)
262 if $cinder_enable_iscsi {
263 $cinder_iscsi_backend = 'tripleo_iscsi'
265 cinder::backend::iscsi { $cinder_iscsi_backend :
266 iscsi_ip_address => hiera('cinder_iscsi_ip_address'),
267 iscsi_helper => hiera('cinder_iscsi_helper'),
274 pg_num => hiera('ceph::profile::params::osd_pool_default_pg_num'),
275 pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'),
276 size => hiera('ceph::profile::params::osd_pool_default_size'),
279 $ceph_pools = hiera('ceph_pools')
280 ceph::pool { $ceph_pools : }
283 if $cinder_enable_rbd_backend {
284 $cinder_rbd_backend = 'tripleo_ceph'
287 "${cinder_rbd_backend}/host": value => 'hostgroup';
290 cinder::backend::rbd { $cinder_rbd_backend :
291 rbd_pool => 'volumes',
292 rbd_user => 'openstack',
293 rbd_secret_uuid => hiera('ceph::profile::params::fsid'),
294 require => Ceph::Pool['volumes'],
298 $cinder_enabled_backends = delete_undef_values([$cinder_iscsi_backend, $cinder_rbd_backend])
299 class { '::cinder::backends' :
300 enabled_backends => $cinder_enabled_backends,
305 include ::swift::proxy
306 include ::swift::proxy::proxy_logging
307 include ::swift::proxy::healthcheck
308 include ::swift::proxy::cache
309 include ::swift::proxy::keystone
310 include ::swift::proxy::authtoken
311 include ::swift::proxy::staticweb
312 include ::swift::proxy::ceilometer
313 include ::swift::proxy::ratelimit
314 include ::swift::proxy::catch_errors
315 include ::swift::proxy::tempurl
316 include ::swift::proxy::formpost
319 class {'swift::storage::all':
320 mount_check => str2bool(hiera('swift_mount_check'))
322 if(!defined(File['/srv/node'])) {
327 require => Package['openstack-swift'],
330 $swift_components = ['account', 'container', 'object']
331 swift::storage::filter::recon { $swift_components : }
332 swift::storage::filter::healthcheck { $swift_components : }
336 include ::ceilometer::api
337 include ::ceilometer::db
338 include ::ceilometer::agent::notification
339 include ::ceilometer::agent::central
340 include ::ceilometer::alarm::notifier
341 include ::ceilometer::alarm::evaluator
342 include ::ceilometer::expirer
343 include ::ceilometer::collector
344 class { 'ceilometer::agent::auth':
345 auth_url => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
348 Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
353 include ::heat::api_cfn
354 include ::heat::api_cloudwatch
355 include ::heat::engine
357 $snmpd_user = hiera('snmpd_readonly_user_name')
358 snmp::snmpv3_user { $snmpd_user:
360 authpass => hiera('snmpd_readonly_user_password'),
363 agentaddress => ['udp:161','udp6:[::1]:161'],
364 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' ],