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',
122 if hiera('step') >= 2 {
126 #TODO: need a cleanup-keystone-tokens.sh solution here
128 'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
130 file { [ '/etc/keystone/ssl', '/etc/keystone/ssl/certs', '/etc/keystone/ssl/private' ]:
131 ensure => 'directory',
134 require => Package['keystone'],
136 file { '/etc/keystone/ssl/certs/signing_cert.pem':
137 content => hiera('keystone_signing_certificate'),
140 notify => Service['keystone'],
141 require => File['/etc/keystone/ssl/certs'],
143 file { '/etc/keystone/ssl/private/signing_key.pem':
144 content => hiera('keystone_signing_key'),
147 notify => Service['keystone'],
148 require => File['/etc/keystone/ssl/private'],
150 file { '/etc/keystone/ssl/certs/ca.pem':
151 content => hiera('keystone_ca_certificate'),
154 notify => Service['keystone'],
155 require => File['/etc/keystone/ssl/certs'],
158 # TODO: swift backend, also notifications, scrubber, etc.
159 include ::glance::api
160 include ::glance::registry
163 rabbit_hosts => [hiera('controller_virtual_ip')],
164 glance_api_servers => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
169 include ::nova::conductor
170 include ::nova::consoleauth
171 include ::nova::vncproxy
172 include ::nova::scheduler
175 rabbit_hosts => [hiera('controller_virtual_ip')],
178 include ::neutron::server
179 include ::neutron::agents::dhcp
180 include ::neutron::agents::l3
182 class { 'neutron::plugins::ml2':
183 flat_networks => split(hiera('neutron_flat_networks'), ','),
184 tenant_network_types => [hiera('neutron_tenant_network_type')],
185 type_drivers => [hiera('neutron_tenant_network_type')],
188 class { 'neutron::agents::ml2::ovs':
189 bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
190 tunnel_types => split(hiera('neutron_tunnel_types'), ','),
193 class { 'neutron::agents::metadata':
194 auth_url => join(['http://', hiera('controller_virtual_ip'), ':35357/v2.0']),
198 rabbit_hosts => [hiera('controller_virtual_ip')],
201 include ::cinder::api
202 include ::cinder::scheduler
203 include ::cinder::volume
204 include ::cinder::volume::iscsi
205 class {'cinder::setup_test_volume':
206 size => join([hiera('cinder_lvm_loop_device_size'), 'M']),