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 hiera('step') >= 1 {
19 class { 'mysql::server':
22 'bind-address' => hiera('controller_host')
27 # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
28 # Create all the database schemas
29 # Example DSN format: mysql://user:password@host/dbname
30 $allowed_hosts = ['%',hiera('controller_host')]
31 $keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
32 class { 'keystone::db::mysql':
33 user => $keystone_dsn[3],
34 password => $keystone_dsn[4],
35 host => $keystone_dsn[5],
36 dbname => $keystone_dsn[6],
37 allowed_hosts => $allowed_hosts,
39 $glance_dsn = split(hiera('glance::api::database_connection'), '[@:/?]')
40 class { 'glance::db::mysql':
41 user => $glance_dsn[3],
42 password => $glance_dsn[4],
43 host => $glance_dsn[5],
44 dbname => $glance_dsn[6],
45 allowed_hosts => $allowed_hosts,
47 $nova_dsn = split(hiera('nova::database_connection'), '[@:/?]')
48 class { 'nova::db::mysql':
50 password => $nova_dsn[4],
52 dbname => $nova_dsn[6],
53 allowed_hosts => $allowed_hosts,
55 $neutron_dsn = split(hiera('neutron::server::database_connection'), '[@:/?]')
56 class { 'neutron::db::mysql':
57 user => $neutron_dsn[3],
58 password => $neutron_dsn[4],
59 host => $neutron_dsn[5],
60 dbname => $neutron_dsn[6],
61 allowed_hosts => $allowed_hosts,
63 $cinder_dsn = split(hiera('cinder::database_connection'), '[@:/?]')
64 class { 'cinder::db::mysql':
65 user => $cinder_dsn[3],
66 password => $cinder_dsn[4],
67 host => $cinder_dsn[5],
68 dbname => $cinder_dsn[6],
69 allowed_hosts => $allowed_hosts,
71 $heat_dsn = split(hiera('heat_dsn'), '[@:/?]')
72 class { 'heat::db::mysql':
74 password => $heat_dsn[4],
76 dbname => $heat_dsn[6],
77 allowed_hosts => $allowed_hosts,
79 $ceilometer_dsn = split(hiera('ceilometer::db::database_connection'), '[@:/?]')
80 class { 'ceilometer::db::mysql':
81 user => $ceilometer_dsn[3],
82 password => $ceilometer_dsn[4],
83 host => $ceilometer_dsn[5],
84 dbname => $ceilometer_dsn[6],
85 allowed_hosts => $allowed_hosts,
88 if $::osfamily == 'RedHat' {
89 $rabbit_provider = 'yum'
91 $rabbit_provider = undef
94 Class['rabbitmq'] -> Rabbitmq_vhost <| |>
95 Class['rabbitmq'] -> Rabbitmq_user <| |>
96 Class['rabbitmq'] -> Rabbitmq_user_permissions <| |>
100 package_provider => $rabbit_provider,
101 config_cluster => false,
102 node_ip_address => hiera('controller_host'),
105 rabbitmq_vhost { '/':
106 provider => 'rabbitmqctl',
108 rabbitmq_user { ['nova','glance','neutron','cinder','ceilometer','heat']:
110 password => hiera('rabbit_password'),
111 provider => 'rabbitmqctl',
114 rabbitmq_user_permissions {[
122 configure_permission => '.*',
123 write_permission => '.*',
124 read_permission => '.*',
125 provider => 'rabbitmqctl',
128 # pre-install swift here so we can build rings
133 if hiera('step') >= 2 {
137 #TODO: need a cleanup-keystone-tokens.sh solution here
139 'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
141 file { [ '/etc/keystone/ssl', '/etc/keystone/ssl/certs', '/etc/keystone/ssl/private' ]:
142 ensure => 'directory',
145 require => Package['keystone'],
147 file { '/etc/keystone/ssl/certs/signing_cert.pem':
148 content => hiera('keystone_signing_certificate'),
151 notify => Service['keystone'],
152 require => File['/etc/keystone/ssl/certs'],
154 file { '/etc/keystone/ssl/private/signing_key.pem':
155 content => hiera('keystone_signing_key'),
158 notify => Service['keystone'],
159 require => File['/etc/keystone/ssl/private'],
161 file { '/etc/keystone/ssl/certs/ca.pem':
162 content => hiera('keystone_ca_certificate'),
165 notify => Service['keystone'],
166 require => File['/etc/keystone/ssl/certs'],
169 # TODO: notifications, scrubber, etc.
170 include ::glance::api
171 include ::glance::registry
172 class { 'glance::backend::swift':
173 swift_store_auth_address => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
177 rabbit_hosts => [hiera('controller_virtual_ip')],
178 glance_api_servers => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
183 include ::nova::conductor
184 include ::nova::consoleauth
185 include ::nova::vncproxy
186 include ::nova::scheduler
189 rabbit_hosts => [hiera('controller_virtual_ip')],
192 include ::neutron::server
193 include ::neutron::agents::dhcp
194 include ::neutron::agents::l3
196 class { 'neutron::plugins::ml2':
197 flat_networks => split(hiera('neutron_flat_networks'), ','),
198 tenant_network_types => [hiera('neutron_tenant_network_type')],
199 type_drivers => [hiera('neutron_tenant_network_type')],
202 class { 'neutron::agents::ml2::ovs':
203 bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
204 tunnel_types => split(hiera('neutron_tunnel_types'), ','),
207 class { 'neutron::agents::metadata':
208 auth_url => join(['http://', hiera('controller_virtual_ip'), ':35357/v2.0']),
212 rabbit_hosts => [hiera('controller_virtual_ip')],
215 include ::cinder::api
216 include ::cinder::scheduler
217 include ::cinder::volume
218 include ::cinder::volume::iscsi
219 class {'cinder::setup_test_volume':
220 size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
225 include ::swift::proxy
226 include ::swift::proxy::proxy_logging
227 include ::swift::proxy::healthcheck
228 include ::swift::proxy::cache
229 include ::swift::proxy::keystone
230 include ::swift::proxy::authtoken
231 include ::swift::proxy::staticweb
232 include ::swift::proxy::ceilometer
233 include ::swift::proxy::ratelimit
234 include ::swift::proxy::catch_errors
235 include ::swift::proxy::tempurl
236 include ::swift::proxy::formpost
239 class {'swift::storage::all':
240 mount_check => str2bool(hiera('swift_mount_check'))
242 if(!defined(File['/srv/node'])) {
247 require => Package['openstack-swift'],
250 $swift_components = ['account', 'container', 'object']
251 swift::storage::filter::recon { $swift_components : }
252 swift::storage::filter::healthcheck { $swift_components : }
256 include ::ceilometer::api
257 include ::ceilometer::db
258 include ::ceilometer::agent::notification
259 include ::ceilometer::agent::central
260 include ::ceilometer::alarm::notifier
261 include ::ceilometer::alarm::evaluator
262 include ::ceilometer::expirer
263 include ::ceilometer::collector
264 class { 'ceilometer::agent::auth':
265 auth_url => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
268 Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }