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 {
42 if str2bool(hiera('enable_galera', 'true')) {
43 $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
45 $mysql_config_file = '/etc/my.cnf.d/server.cnf'
49 class { 'mysql::server':
50 config_file => $mysql_config_file,
53 'bind-address' => hiera('controller_host')
58 # FIXME: this should only occur on the bootstrap host (ditto for db syncs)
59 # Create all the database schemas
60 # Example DSN format: mysql://user:password@host/dbname
61 $allowed_hosts = ['%',hiera('controller_host')]
62 $keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
63 class { 'keystone::db::mysql':
64 user => $keystone_dsn[3],
65 password => $keystone_dsn[4],
66 host => $keystone_dsn[5],
67 dbname => $keystone_dsn[6],
68 allowed_hosts => $allowed_hosts,
70 $glance_dsn = split(hiera('glance::api::database_connection'), '[@:/?]')
71 class { 'glance::db::mysql':
72 user => $glance_dsn[3],
73 password => $glance_dsn[4],
74 host => $glance_dsn[5],
75 dbname => $glance_dsn[6],
76 allowed_hosts => $allowed_hosts,
78 $nova_dsn = split(hiera('nova::database_connection'), '[@:/?]')
79 class { 'nova::db::mysql':
81 password => $nova_dsn[4],
83 dbname => $nova_dsn[6],
84 allowed_hosts => $allowed_hosts,
86 $neutron_dsn = split(hiera('neutron::server::database_connection'), '[@:/?]')
87 class { 'neutron::db::mysql':
88 user => $neutron_dsn[3],
89 password => $neutron_dsn[4],
90 host => $neutron_dsn[5],
91 dbname => $neutron_dsn[6],
92 allowed_hosts => $allowed_hosts,
94 $cinder_dsn = split(hiera('cinder::database_connection'), '[@:/?]')
95 class { 'cinder::db::mysql':
96 user => $cinder_dsn[3],
97 password => $cinder_dsn[4],
98 host => $cinder_dsn[5],
99 dbname => $cinder_dsn[6],
100 allowed_hosts => $allowed_hosts,
102 $heat_dsn = split(hiera('heat::database_connection'), '[@:/?]')
103 class { 'heat::db::mysql':
104 user => $heat_dsn[3],
105 password => $heat_dsn[4],
106 host => $heat_dsn[5],
107 dbname => $heat_dsn[6],
108 allowed_hosts => $allowed_hosts,
110 $ceilometer_dsn = split(hiera('ceilometer::db::database_connection'), '[@:/?]')
111 class { 'ceilometer::db::mysql':
112 user => $ceilometer_dsn[3],
113 password => $ceilometer_dsn[4],
114 host => $ceilometer_dsn[5],
115 dbname => $ceilometer_dsn[6],
116 allowed_hosts => $allowed_hosts,
119 $rabbit_nodes = split(downcase(hiera('rabbit_node_names', $::hostname)), ',')
120 if count($rabbit_nodes) > 1 {
121 $rabbit_cluster = true
124 $rabbit_cluster = false
127 config_cluster => $rabbit_cluster,
128 cluster_nodes => $rabbit_nodes,
129 node_ip_address => hiera('controller_host'),
132 rabbitmq_policy { 'ha-all@/':
133 pattern => '^(?!amq\.).*',
136 'ha-sync-mode' => 'automatic',
140 rabbitmq_vhost { '/':
141 provider => 'rabbitmqctl',
144 # pre-install swift here so we can build rings
147 $cinder_enable_rbd_backend = hiera('cinder_enable_rbd_backend', false)
148 $enable_ceph = $cinder_enable_rbd_backend
151 class { 'ceph::profile::params':
152 mon_initial_members => downcase(hiera('ceph_mon_initial_members'))
154 include ::ceph::profile::mon
159 if hiera('step') >= 3 {
163 #TODO: need a cleanup-keystone-tokens.sh solution here
165 'ec2/driver': value => 'keystone.contrib.ec2.backends.sql.Ec2';
167 file { [ '/etc/keystone/ssl', '/etc/keystone/ssl/certs', '/etc/keystone/ssl/private' ]:
168 ensure => 'directory',
171 require => Package['keystone'],
173 file { '/etc/keystone/ssl/certs/signing_cert.pem':
174 content => hiera('keystone_signing_certificate'),
177 notify => Service['keystone'],
178 require => File['/etc/keystone/ssl/certs'],
180 file { '/etc/keystone/ssl/private/signing_key.pem':
181 content => hiera('keystone_signing_key'),
184 notify => Service['keystone'],
185 require => File['/etc/keystone/ssl/private'],
187 file { '/etc/keystone/ssl/certs/ca.pem':
188 content => hiera('keystone_ca_certificate'),
191 notify => Service['keystone'],
192 require => File['/etc/keystone/ssl/certs'],
195 # TODO: notifications, scrubber, etc.
196 include ::glance::api
197 include ::glance::registry
198 include ::glance::backend::swift
201 glance_api_servers => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
206 include ::nova::conductor
207 include ::nova::consoleauth
208 include ::nova::network::neutron
209 include ::nova::vncproxy
210 include ::nova::scheduler
213 include ::neutron::server
214 include ::neutron::agents::dhcp
215 include ::neutron::agents::l3
217 file { '/etc/neutron/dnsmasq-neutron.conf':
218 content => hiera('neutron_dnsmasq_options'),
221 notify => Service['neutron-dhcp-service'],
222 require => Package['neutron'],
225 class { 'neutron::plugins::ml2':
226 flat_networks => split(hiera('neutron_flat_networks'), ','),
227 tenant_network_types => [hiera('neutron_tenant_network_type')],
228 type_drivers => [hiera('neutron_tenant_network_type')],
231 class { 'neutron::agents::ml2::ovs':
232 bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
233 tunnel_types => split(hiera('neutron_tunnel_types'), ','),
236 class { 'neutron::agents::metadata':
237 auth_url => join(['http://', hiera('controller_virtual_ip'), ':35357/v2.0']),
240 Service['neutron-server'] -> Service['neutron-dhcp-service']
241 Service['neutron-server'] -> Service['neutron-l3']
242 Service['neutron-server'] -> Service['neutron-ovs-agent-service']
243 Service['neutron-server'] -> Service['neutron-metadata']
246 include ::cinder::api
247 include ::cinder::glance
248 include ::cinder::scheduler
249 include ::cinder::volume
250 class {'cinder::setup_test_volume':
251 size => join([hiera('cinder_lvm_loop_device_size'), 'M']),
254 $cinder_enable_iscsi = hiera('cinder_enable_iscsi_backend', true)
255 if $cinder_enable_iscsi {
256 $cinder_iscsi_backend = 'tripleo_iscsi'
258 cinder::backend::iscsi { $cinder_iscsi_backend :
259 iscsi_ip_address => hiera('cinder_iscsi_ip_address'),
260 iscsi_helper => hiera('cinder_iscsi_helper'),
267 pg_num => hiera('ceph::profile::params::osd_pool_default_pg_num'),
268 pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'),
269 size => hiera('ceph::profile::params::osd_pool_default_size'),
272 $ceph_pools = hiera('ceph_pools')
273 ceph::pool { $ceph_pools : }
276 if $cinder_enable_rbd_backend {
277 $cinder_rbd_backend = 'tripleo_ceph'
280 "${cinder_rbd_backend}/host": value => 'hostgroup';
283 cinder::backend::rbd { $cinder_rbd_backend :
284 rbd_pool => 'volumes',
285 rbd_user => 'openstack',
286 rbd_secret_uuid => hiera('ceph::profile::params::fsid'),
287 require => Ceph::Pool['volumes'],
291 $cinder_enabled_backends = delete_undef_values([$cinder_iscsi_backend, $cinder_rbd_backend])
292 class { '::cinder::backends' :
293 enabled_backends => $cinder_enabled_backends,
298 include ::swift::proxy
299 include ::swift::proxy::proxy_logging
300 include ::swift::proxy::healthcheck
301 include ::swift::proxy::cache
302 include ::swift::proxy::keystone
303 include ::swift::proxy::authtoken
304 include ::swift::proxy::staticweb
305 include ::swift::proxy::ceilometer
306 include ::swift::proxy::ratelimit
307 include ::swift::proxy::catch_errors
308 include ::swift::proxy::tempurl
309 include ::swift::proxy::formpost
312 class {'swift::storage::all':
313 mount_check => str2bool(hiera('swift_mount_check'))
315 if(!defined(File['/srv/node'])) {
320 require => Package['openstack-swift'],
323 $swift_components = ['account', 'container', 'object']
324 swift::storage::filter::recon { $swift_components : }
325 swift::storage::filter::healthcheck { $swift_components : }
329 include ::ceilometer::api
330 include ::ceilometer::db
331 include ::ceilometer::agent::notification
332 include ::ceilometer::agent::central
333 include ::ceilometer::alarm::notifier
334 include ::ceilometer::alarm::evaluator
335 include ::ceilometer::expirer
336 include ::ceilometer::collector
337 class { 'ceilometer::agent::auth':
338 auth_url => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
341 Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
346 include ::heat::api_cfn
347 include ::heat::api_cloudwatch
348 include ::heat::engine
350 $snmpd_user = hiera('snmpd_readonly_user_name')
351 snmp::snmpv3_user { $snmpd_user:
353 authpass => hiera('snmpd_readonly_user_password'),
356 agentaddress => ['udp:161','udp6:[::1]:161'],
357 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' ],