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 $rabbit_nodes = split(downcase(hiera('rabbit_node_names', $::hostname)), ',')
113 if count($rabbit_nodes) > 1 {
114 $rabbit_cluster = true
117 $rabbit_cluster = false
120 config_cluster => $rabbit_cluster,
121 cluster_nodes => $rabbit_nodes,
122 node_ip_address => hiera('controller_host'),
125 rabbitmq_policy { 'ha-all@/':
126 pattern => '^(?!amq\.).*',
129 'ha-sync-mode' => 'automatic',
133 rabbitmq_vhost { '/':
134 provider => 'rabbitmqctl',
137 # pre-install swift here so we can build rings
140 $cinder_enable_rbd_backend = hiera('cinder_enable_rbd_backend', false)
141 $enable_ceph = $cinder_enable_rbd_backend
144 class { 'ceph::profile::params':
145 mon_initial_members => downcase(hiera('ceph_mon_initial_members'))
147 include ::ceph::profile::mon
152 if hiera('step') >= 3 {
156 #TODO: need a cleanup-keystone-tokens.sh solution here
158 'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
160 file { [ '/etc/keystone/ssl', '/etc/keystone/ssl/certs', '/etc/keystone/ssl/private' ]:
161 ensure => 'directory',
164 require => Package['keystone'],
166 file { '/etc/keystone/ssl/certs/signing_cert.pem':
167 content => hiera('keystone_signing_certificate'),
170 notify => Service['keystone'],
171 require => File['/etc/keystone/ssl/certs'],
173 file { '/etc/keystone/ssl/private/signing_key.pem':
174 content => hiera('keystone_signing_key'),
177 notify => Service['keystone'],
178 require => File['/etc/keystone/ssl/private'],
180 file { '/etc/keystone/ssl/certs/ca.pem':
181 content => hiera('keystone_ca_certificate'),
184 notify => Service['keystone'],
185 require => File['/etc/keystone/ssl/certs'],
188 # TODO: notifications, scrubber, etc.
189 include ::glance::api
190 include ::glance::registry
191 include ::glance::backend::swift
194 glance_api_servers => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
199 include ::nova::conductor
200 include ::nova::consoleauth
201 include ::nova::network::neutron
202 include ::nova::vncproxy
203 include ::nova::scheduler
206 include ::neutron::server
207 include ::neutron::agents::dhcp
208 include ::neutron::agents::l3
210 file { '/etc/neutron/dnsmasq-neutron.conf':
211 content => hiera('neutron_dnsmasq_options'),
214 notify => Service['neutron-dhcp-service'],
215 require => Package['neutron'],
218 class { 'neutron::plugins::ml2':
219 flat_networks => split(hiera('neutron_flat_networks'), ','),
220 tenant_network_types => [hiera('neutron_tenant_network_type')],
221 type_drivers => [hiera('neutron_tenant_network_type')],
224 class { 'neutron::agents::ml2::ovs':
225 bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
226 tunnel_types => split(hiera('neutron_tunnel_types'), ','),
229 class { 'neutron::agents::metadata':
230 auth_url => join(['http://', hiera('controller_virtual_ip'), ':35357/v2.0']),
233 Service['neutron-server'] -> Service['neutron-dhcp-service']
234 Service['neutron-server'] -> Service['neutron-l3']
235 Service['neutron-server'] -> Service['neutron-ovs-agent-service']
236 Service['neutron-server'] -> Service['neutron-metadata']
239 include ::cinder::api
240 include ::cinder::glance
241 include ::cinder::scheduler
242 include ::cinder::volume
243 class {'cinder::setup_test_volume':
244 size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
247 $cinder_enable_iscsi = hiera('cinder_enable_iscsi_backend', true)
248 if $cinder_enable_iscsi {
249 $cinder_iscsi_backend = 'tripleo_iscsi'
251 cinder::backend::iscsi { $cinder_iscsi_backend :
252 iscsi_ip_address => hiera('cinder_iscsi_ip_address'),
253 iscsi_helper => hiera('cinder_iscsi_helper'),
260 pg_num => hiera('ceph::profile::params::osd_pool_default_pg_num'),
261 pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'),
262 size => hiera('ceph::profile::params::osd_pool_default_size'),
265 $ceph_pools = hiera('ceph_pools')
266 ceph::pool { $ceph_pools : }
269 if $cinder_enable_rbd_backend {
270 $cinder_rbd_backend = 'tripleo_ceph'
273 "${cinder_rbd_backend}/host": value => 'hostgroup';
276 cinder::backend::rbd { $cinder_rbd_backend :
277 rbd_pool => 'volumes',
278 rbd_user => 'openstack',
279 rbd_secret_uuid => hiera('ceph::profile::params::fsid'),
280 require => Ceph::Pool['volumes'],
284 $cinder_enabled_backends = delete_undef_values([$cinder_iscsi_backend, $cinder_rbd_backend])
285 class { '::cinder::backends' :
286 enabled_backends => $cinder_enabled_backends,
291 include ::swift::proxy
292 include ::swift::proxy::proxy_logging
293 include ::swift::proxy::healthcheck
294 include ::swift::proxy::cache
295 include ::swift::proxy::keystone
296 include ::swift::proxy::authtoken
297 include ::swift::proxy::staticweb
298 include ::swift::proxy::ceilometer
299 include ::swift::proxy::ratelimit
300 include ::swift::proxy::catch_errors
301 include ::swift::proxy::tempurl
302 include ::swift::proxy::formpost
305 class {'swift::storage::all':
306 mount_check => str2bool(hiera('swift_mount_check'))
308 if(!defined(File['/srv/node'])) {
313 require => Package['openstack-swift'],
316 $swift_components = ['account', 'container', 'object']
317 swift::storage::filter::recon { $swift_components : }
318 swift::storage::filter::healthcheck { $swift_components : }
322 include ::ceilometer::api
323 include ::ceilometer::db
324 include ::ceilometer::agent::notification
325 include ::ceilometer::agent::central
326 include ::ceilometer::alarm::notifier
327 include ::ceilometer::alarm::evaluator
328 include ::ceilometer::expirer
329 include ::ceilometer::collector
330 class { 'ceilometer::agent::auth':
331 auth_url => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
334 Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
339 include ::heat::api_cfn
340 include ::heat::api_cloudwatch
341 include ::heat::engine
343 $snmpd_user = hiera('snmpd_readonly_user_name')
344 snmp::snmpv3_user { $snmpd_user:
346 authpass => hiera('snmpd_readonly_user_password'),
349 agentaddress => ['udp:161','udp6:[::1]:161'],
350 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' ],