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,
80 if $::osfamily == 'RedHat' {
81 $rabbit_provider = 'yum'
83 $rabbit_provider = undef
86 Class['rabbitmq'] -> Rabbitmq_vhost <| |>
87 Class['rabbitmq'] -> Rabbitmq_user <| |>
88 Class['rabbitmq'] -> Rabbitmq_user_permissions <| |>
92 package_provider => $rabbit_provider,
93 config_cluster => false,
94 node_ip_address => hiera('controller_host'),
98 provider => 'rabbitmqctl',
100 rabbitmq_user { ['nova','glance','neutron','cinder','ceilometer','heat']:
102 password => hiera('rabbit_password'),
103 provider => 'rabbitmqctl',
106 rabbitmq_user_permissions {[
114 configure_permission => '.*',
115 write_permission => '.*',
116 read_permission => '.*',
117 provider => 'rabbitmqctl',
120 # pre-install swift here so we can build rings
125 if hiera('step') >= 2 {
129 #TODO: need a cleanup-keystone-tokens.sh solution here
131 'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
133 file { [ '/etc/keystone/ssl', '/etc/keystone/ssl/certs', '/etc/keystone/ssl/private' ]:
134 ensure => 'directory',
137 require => Package['keystone'],
139 file { '/etc/keystone/ssl/certs/signing_cert.pem':
140 content => hiera('keystone_signing_certificate'),
143 notify => Service['keystone'],
144 require => File['/etc/keystone/ssl/certs'],
146 file { '/etc/keystone/ssl/private/signing_key.pem':
147 content => hiera('keystone_signing_key'),
150 notify => Service['keystone'],
151 require => File['/etc/keystone/ssl/private'],
153 file { '/etc/keystone/ssl/certs/ca.pem':
154 content => hiera('keystone_ca_certificate'),
157 notify => Service['keystone'],
158 require => File['/etc/keystone/ssl/certs'],
161 # TODO: swift backend, also notifications, scrubber, etc.
162 include ::glance::api
163 include ::glance::registry
166 rabbit_hosts => [hiera('controller_virtual_ip')],
167 glance_api_servers => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
172 include ::nova::conductor
173 include ::nova::consoleauth
174 include ::nova::vncproxy
175 include ::nova::scheduler
178 rabbit_hosts => [hiera('controller_virtual_ip')],
181 include ::neutron::server
182 include ::neutron::agents::dhcp
183 include ::neutron::agents::l3
185 class { 'neutron::plugins::ml2':
186 flat_networks => split(hiera('neutron_flat_networks'), ','),
187 tenant_network_types => [hiera('neutron_tenant_network_type')],
188 type_drivers => [hiera('neutron_tenant_network_type')],
191 class { 'neutron::agents::ml2::ovs':
192 bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
193 tunnel_types => split(hiera('neutron_tunnel_types'), ','),
196 class { 'neutron::agents::metadata':
197 auth_url => join(['http://', hiera('controller_virtual_ip'), ':35357/v2.0']),
201 rabbit_hosts => [hiera('controller_virtual_ip')],
204 include ::cinder::api
205 include ::cinder::scheduler
206 include ::cinder::volume
207 include ::cinder::volume::iscsi
208 class {'cinder::setup_test_volume':
209 size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
214 include ::swift::proxy
215 include ::swift::proxy::proxy_logging
216 include ::swift::proxy::healthcheck
217 include ::swift::proxy::cache
218 include ::swift::proxy::keystone
219 include ::swift::proxy::authtoken
220 include ::swift::proxy::staticweb
221 include ::swift::proxy::ratelimit
222 include ::swift::proxy::catch_errors
223 include ::swift::proxy::tempurl
224 include ::swift::proxy::formpost
227 class {'swift::storage::all':
228 mount_check => str2bool(hiera('swift_mount_check'))
230 if(!defined(File['/srv/node'])) {
235 require => Package['openstack-swift'],
238 $swift_components = ['account', 'container', 'object']
239 swift::storage::filter::recon { $swift_components : }
240 swift::storage::filter::healthcheck { $swift_components : }