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 if count(hiera('ntp::servers')) > 0 {
34 class { 'mysql::server':
37 'bind-address' => hiera('controller_host')
42 # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
43 # Create all the database schemas
44 # Example DSN format: mysql://user:password@host/dbname
45 $allowed_hosts = ['%',hiera('controller_host')]
46 $keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
47 class { 'keystone::db::mysql':
48 user => $keystone_dsn[3],
49 password => $keystone_dsn[4],
50 host => $keystone_dsn[5],
51 dbname => $keystone_dsn[6],
52 allowed_hosts => $allowed_hosts,
54 $glance_dsn = split(hiera('glance::api::database_connection'), '[@:/?]')
55 class { 'glance::db::mysql':
56 user => $glance_dsn[3],
57 password => $glance_dsn[4],
58 host => $glance_dsn[5],
59 dbname => $glance_dsn[6],
60 allowed_hosts => $allowed_hosts,
62 $nova_dsn = split(hiera('nova::database_connection'), '[@:/?]')
63 class { 'nova::db::mysql':
65 password => $nova_dsn[4],
67 dbname => $nova_dsn[6],
68 allowed_hosts => $allowed_hosts,
70 $neutron_dsn = split(hiera('neutron::server::database_connection'), '[@:/?]')
71 class { 'neutron::db::mysql':
72 user => $neutron_dsn[3],
73 password => $neutron_dsn[4],
74 host => $neutron_dsn[5],
75 dbname => $neutron_dsn[6],
76 allowed_hosts => $allowed_hosts,
78 $cinder_dsn = split(hiera('cinder::database_connection'), '[@:/?]')
79 class { 'cinder::db::mysql':
80 user => $cinder_dsn[3],
81 password => $cinder_dsn[4],
82 host => $cinder_dsn[5],
83 dbname => $cinder_dsn[6],
84 allowed_hosts => $allowed_hosts,
86 $heat_dsn = split(hiera('heat::database_connection'), '[@:/?]')
87 class { 'heat::db::mysql':
89 password => $heat_dsn[4],
91 dbname => $heat_dsn[6],
92 allowed_hosts => $allowed_hosts,
94 $ceilometer_dsn = split(hiera('ceilometer::db::database_connection'), '[@:/?]')
95 class { 'ceilometer::db::mysql':
96 user => $ceilometer_dsn[3],
97 password => $ceilometer_dsn[4],
98 host => $ceilometer_dsn[5],
99 dbname => $ceilometer_dsn[6],
100 allowed_hosts => $allowed_hosts,
103 if $::osfamily == 'RedHat' {
104 $rabbit_provider = 'yum'
106 $rabbit_provider = undef
109 Class['rabbitmq'] -> Rabbitmq_vhost <| |>
110 Class['rabbitmq'] -> Rabbitmq_user <| |>
111 Class['rabbitmq'] -> Rabbitmq_user_permissions <| |>
113 $rabbit_nodes = split(downcase(hiera('rabbit_nodes', $::hostname)), ',')
114 if count($rabbit_nodes) > 1 {
115 $rabbit_cluster = true
118 $rabbit_cluster = false
121 package_provider => $rabbit_provider,
122 config_cluster => $rabbit_cluster,
123 cluster_nodes => $rabbit_nodes,
124 node_ip_address => hiera('controller_host'),
127 rabbitmq_vhost { '/':
128 provider => 'rabbitmqctl',
130 rabbitmq_user { ['nova','glance','neutron','cinder','ceilometer','heat']:
132 password => hiera('rabbit_password'),
133 provider => 'rabbitmqctl',
136 rabbitmq_user_permissions {[
144 configure_permission => '.*',
145 write_permission => '.*',
146 read_permission => '.*',
147 provider => 'rabbitmqctl',
150 # pre-install swift here so we can build rings
155 if hiera('step') >= 2 {
159 #TODO: need a cleanup-keystone-tokens.sh solution here
161 'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
163 file { [ '/etc/keystone/ssl', '/etc/keystone/ssl/certs', '/etc/keystone/ssl/private' ]:
164 ensure => 'directory',
167 require => Package['keystone'],
169 file { '/etc/keystone/ssl/certs/signing_cert.pem':
170 content => hiera('keystone_signing_certificate'),
173 notify => Service['keystone'],
174 require => File['/etc/keystone/ssl/certs'],
176 file { '/etc/keystone/ssl/private/signing_key.pem':
177 content => hiera('keystone_signing_key'),
180 notify => Service['keystone'],
181 require => File['/etc/keystone/ssl/private'],
183 file { '/etc/keystone/ssl/certs/ca.pem':
184 content => hiera('keystone_ca_certificate'),
187 notify => Service['keystone'],
188 require => File['/etc/keystone/ssl/certs'],
191 # TODO: notifications, scrubber, etc.
192 include ::glance::api
193 include ::glance::registry
194 class { 'glance::backend::swift':
195 swift_store_auth_address => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
199 rabbit_hosts => [hiera('controller_virtual_ip')],
200 glance_api_servers => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
205 include ::nova::conductor
206 include ::nova::consoleauth
207 include ::nova::vncproxy
208 include ::nova::scheduler
211 rabbit_hosts => [hiera('controller_virtual_ip')],
214 include ::neutron::server
215 include ::neutron::agents::dhcp
216 include ::neutron::agents::l3
218 file { '/etc/neutron/dnsmasq-neutron.conf':
219 content => hiera('neutron_dnsmasq_options'),
222 notify => Service['neutron-dhcp-service'],
223 require => Package['neutron'],
226 class { 'neutron::plugins::ml2':
227 flat_networks => split(hiera('neutron_flat_networks'), ','),
228 tenant_network_types => [hiera('neutron_tenant_network_type')],
229 type_drivers => [hiera('neutron_tenant_network_type')],
232 class { 'neutron::agents::ml2::ovs':
233 bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
234 tunnel_types => split(hiera('neutron_tunnel_types'), ','),
237 class { 'neutron::agents::metadata':
238 auth_url => join(['http://', hiera('controller_virtual_ip'), ':35357/v2.0']),
242 rabbit_hosts => [hiera('controller_virtual_ip')],
245 include ::cinder::api
246 include ::cinder::scheduler
247 include ::cinder::volume
248 include ::cinder::volume::iscsi
249 class {'cinder::setup_test_volume':
250 size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
255 include ::swift::proxy
256 include ::swift::proxy::proxy_logging
257 include ::swift::proxy::healthcheck
258 include ::swift::proxy::cache
259 include ::swift::proxy::keystone
260 include ::swift::proxy::authtoken
261 include ::swift::proxy::staticweb
262 include ::swift::proxy::ceilometer
263 include ::swift::proxy::ratelimit
264 include ::swift::proxy::catch_errors
265 include ::swift::proxy::tempurl
266 include ::swift::proxy::formpost
269 class {'swift::storage::all':
270 mount_check => str2bool(hiera('swift_mount_check'))
272 if(!defined(File['/srv/node'])) {
277 require => Package['openstack-swift'],
280 $swift_components = ['account', 'container', 'object']
281 swift::storage::filter::recon { $swift_components : }
282 swift::storage::filter::healthcheck { $swift_components : }
286 include ::ceilometer::api
287 include ::ceilometer::db
288 include ::ceilometer::agent::notification
289 include ::ceilometer::agent::central
290 include ::ceilometer::alarm::notifier
291 include ::ceilometer::alarm::evaluator
292 include ::ceilometer::expirer
293 include ::ceilometer::collector
294 class { 'ceilometer::agent::auth':
295 auth_url => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
298 Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
303 include ::heat::api_cfn
304 include ::heat::api_cloudwatch
305 include ::heat::engine
308 'DEFAULT/instance_user': value => 'heat-admin';
311 $snmpd_user = hiera('snmpd_readonly_user_name')
312 snmp::snmpv3_user { $snmpd_user:
314 authpass => hiera('snmpd_readonly_user_password'),
317 agentaddress => ['udp:161','udp6:[::1]:161'],
318 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' ],