if hiera('step') >= 1 {
- include ::tripleo::loadbalancer
+ create_resources(sysctl::value, hiera('sysctl_settings'), {})
+
+ $controller_node_ips = split(hiera('controller_node_ips'), ',')
+
+ class { '::tripleo::loadbalancer' :
+ controller_hosts => $controller_node_ips,
+ manage_vip => true,
+ }
}
include ::ntp
}
+ # MongoDB
+ if downcase(hiera('ceilometer_backend')) == 'mongodb' {
+ include ::mongodb::globals
+
+ include ::mongodb::server
+ $mongo_node_ips_with_port = suffix(hiera('mongo_node_ips'), ':27017')
+ $mongo_node_string = join($mongo_node_ips_with_port, ',')
+
+ $mongodb_replset = hiera('mongodb::server::replset')
+ $ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
+ if downcase(hiera('bootstrap_nodeid')) == $::hostname {
+ mongodb_replset { $mongodb_replset :
+ members => $mongo_node_ips_with_port,
+ }
+ }
+ }
+
+ # Redis
+ $redis_node_ips = hiera('redis_node_ips')
+ $redis_master_hostname = downcase(hiera('bootstrap_nodeid'))
+
+ if $redis_master_hostname == $::hostname {
+ $slaveof = undef
+ } else {
+ $slaveof = "${redis_master_hostname} 6379"
+ }
+ class {'::redis' :
+ slaveof => $slaveof,
+ }
+
+ if count($redis_node_ips) > 1 {
+ Class['::tripleo::redis_notification'] -> Service['redis-sentinel']
+ include ::redis::sentinel
+ include ::tripleo::redis_notification
+ }
+
+ if str2bool(hiera('enable_galera', 'true')) {
+ $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
+ } else {
+ $mysql_config_file = '/etc/my.cnf.d/server.cnf'
+ }
# TODO Galara
class { 'mysql::server':
+ config_file => $mysql_config_file,
override_options => {
'mysqld' => {
- 'bind-address' => hiera('controller_host')
- }
+ 'bind-address' => hiera('mysql_bind_host'),
+ 'max_connections' => '1024',
+ 'open_files_limit' => '-1',
+ },
}
}
# FIXME: this should only occur on the bootstrap host (ditto for db syncs)
# Create all the database schemas
# Example DSN format: mysql://user:password@host/dbname
- $allowed_hosts = ['%',hiera('controller_host')]
+ $allowed_hosts = ['%',hiera('mysql_bind_host')]
$keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
class { 'keystone::db::mysql':
user => $keystone_dsn[3],
dbname => $heat_dsn[6],
allowed_hosts => $allowed_hosts,
}
- $ceilometer_dsn = split(hiera('ceilometer::db::database_connection'), '[@:/?]')
- class { 'ceilometer::db::mysql':
- user => $ceilometer_dsn[3],
- password => $ceilometer_dsn[4],
- host => $ceilometer_dsn[5],
- dbname => $ceilometer_dsn[6],
- allowed_hosts => $allowed_hosts,
- }
-
- if $::osfamily == 'RedHat' {
- $rabbit_provider = 'yum'
- } else {
- $rabbit_provider = undef
+ if downcase(hiera('ceilometer_backend')) == 'mysql' {
+ $ceilometer_dsn = split(hiera('ceilometer_mysql_conn_string'), '[@:/?]')
+ class { 'ceilometer::db::mysql':
+ user => $ceilometer_dsn[3],
+ password => $ceilometer_dsn[4],
+ host => $ceilometer_dsn[5],
+ dbname => $ceilometer_dsn[6],
+ allowed_hosts => $allowed_hosts,
+ }
}
- Class['rabbitmq'] -> Rabbitmq_vhost <| |>
- Class['rabbitmq'] -> Rabbitmq_user <| |>
- Class['rabbitmq'] -> Rabbitmq_user_permissions <| |>
-
- $rabbit_nodes = split(downcase(hiera('rabbit_node_names', $::hostname)), ',')
+ $rabbit_nodes = hiera('rabbit_node_ips')
if count($rabbit_nodes) > 1 {
- $rabbit_cluster = true
- }
- else {
- $rabbit_cluster = false
- }
- class { 'rabbitmq':
- package_provider => $rabbit_provider,
- config_cluster => $rabbit_cluster,
- cluster_nodes => $rabbit_nodes,
- node_ip_address => hiera('controller_host'),
- }
-
- rabbitmq_vhost { '/':
- provider => 'rabbitmqctl',
- }
- rabbitmq_user { ['nova','glance','neutron','cinder','ceilometer','heat']:
- admin => true,
- password => hiera('rabbit_password'),
- provider => 'rabbitmqctl',
- }
-
- rabbitmq_user_permissions {[
- 'nova@/',
- 'glance@/',
- 'neutron@/',
- 'cinder@/',
- 'ceilometer@/',
- 'heat@/',
- ]:
- configure_permission => '.*',
- write_permission => '.*',
- read_permission => '.*',
- provider => 'rabbitmqctl',
+ class { '::rabbitmq':
+ config_cluster => true,
+ cluster_nodes => $rabbit_nodes,
+ tcp_keepalive => false,
+ config_kernel_variables => hiera('rabbitmq_kernel_variables'),
+ config_variables => hiera('rabbitmq_config_variables'),
+ environment_variables => hiera('rabbitmq_environment'),
+ }
+ rabbitmq_policy { 'ha-all@/':
+ pattern => '^(?!amq\.).*',
+ definition => {
+ 'ha-mode' => 'all',
+ },
+ }
+ } else {
+ include ::rabbitmq
}
# pre-install swift here so we can build rings
include ::ceph::profile::mon
}
- if $cinder_enable_rbd_backend {
- ceph::key { 'client.openstack' :
- secret => hiera('ceph::profile::params::mon_key'),
- cap_mon => hiera('ceph_openstack_default_cap_mon'),
- cap_osd => hiera('ceph_openstack_default_cap_osd'),
- user => 'cinder',
- inject => 'true',
- }
+ if str2bool(hiera('enable_ceph_storage', 'false')) {
+ include ::ceph::profile::client
+ include ::ceph::profile::osd
}
} #END STEP 2
require => File['/etc/keystone/ssl/certs'],
}
- # TODO: notifications, scrubber, etc.
- include ::glance::api
- include ::glance::registry
- include ::glance::backend::swift
+ $glance_backend = downcase(hiera('glance_backend', 'swift'))
+ case $glance_backend {
+ swift: { $glance_store = 'glance.store.swift.Store' }
+ file: { $glance_store = 'glance.store.filesystem.Store' }
+ rbd: { $glance_store = 'glance.store.rbd.Store' }
+ default: { fail('Unrecognized glance_backend parameter.') }
+ }
- class { 'nova':
- rabbit_hosts => [hiera('controller_virtual_ip')],
- glance_api_servers => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),
+ # TODO: notifications, scrubber, etc.
+ include ::glance
+ class { 'glance::api':
+ known_stores => [$glance_store]
}
+ include ::glance::registry
+ include join(['::glance::backend::', $glance_backend])
+ include ::nova
include ::nova::api
include ::nova::cert
include ::nova::conductor
include ::nova::vncproxy
include ::nova::scheduler
- class {'neutron':
- rabbit_hosts => [hiera('controller_virtual_ip')],
- }
-
+ include ::neutron
include ::neutron::server
- include ::neutron::agents::dhcp
include ::neutron::agents::l3
+ include ::neutron::agents::dhcp
+ include ::neutron::agents::metadata
file { '/etc/neutron/dnsmasq-neutron.conf':
content => hiera('neutron_dnsmasq_options'),
}
class { 'neutron::plugins::ml2':
- flat_networks => split(hiera('neutron_flat_networks'), ','),
+ flat_networks => split(hiera('neutron_flat_networks'), ','),
tenant_network_types => [hiera('neutron_tenant_network_type')],
- type_drivers => [hiera('neutron_tenant_network_type')],
}
-
class { 'neutron::agents::ml2::ovs':
- bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
- tunnel_types => split(hiera('neutron_tunnel_types'), ','),
- }
-
- class { 'neutron::agents::metadata':
- auth_url => join(['http://', hiera('controller_virtual_ip'), ':35357/v2.0']),
+ bridge_mappings => split(hiera('neutron_bridge_mappings'), ','),
+ tunnel_types => split(hiera('neutron_tunnel_types'), ','),
}
Service['neutron-server'] -> Service['neutron-dhcp-service']
Service['neutron-server'] -> Service['neutron-ovs-agent-service']
Service['neutron-server'] -> Service['neutron-metadata']
- class {'cinder':
- rabbit_hosts => [hiera('controller_virtual_ip')],
- }
-
+ include ::cinder
include ::cinder::api
include ::cinder::glance
include ::cinder::scheduler
include ::swift::proxy::formpost
# swift storage
- class {'swift::storage::all':
- mount_check => str2bool(hiera('swift_mount_check'))
- }
- if(!defined(File['/srv/node'])) {
- file { '/srv/node':
- ensure => directory,
- owner => 'swift',
- group => 'swift',
- require => Package['openstack-swift'],
+ if str2bool(hiera('enable_swift_storage', 'true')) {
+ class {'swift::storage::all':
+ mount_check => str2bool(hiera('swift_mount_check'))
}
+ if(!defined(File['/srv/node'])) {
+ file { '/srv/node':
+ ensure => directory,
+ owner => 'swift',
+ group => 'swift',
+ require => Package['openstack-swift'],
+ }
+ }
+ $swift_components = ['account', 'container', 'object']
+ swift::storage::filter::recon { $swift_components : }
+ swift::storage::filter::healthcheck { $swift_components : }
}
- $swift_components = ['account', 'container', 'object']
- swift::storage::filter::recon { $swift_components : }
- swift::storage::filter::healthcheck { $swift_components : }
# Ceilometer
+ $ceilometer_backend = downcase(hiera('ceilometer_backend'))
+ case $ceilometer_backend {
+ /mysql/ : {
+ $ceilometer_database_connection = hiera('ceilometer_mysql_conn_string')
+ }
+ default : {
+ $ceilometer_database_connection = $ceilometer_mongodb_conn_string
+ }
+ }
include ::ceilometer
include ::ceilometer::api
- include ::ceilometer::db
include ::ceilometer::agent::notification
include ::ceilometer::agent::central
include ::ceilometer::alarm::notifier
include ::ceilometer::alarm::evaluator
include ::ceilometer::expirer
include ::ceilometer::collector
- class { 'ceilometer::agent::auth':
- auth_url => join(['http://', hiera('controller_virtual_ip'), ':5000/v2.0']),
+ include ceilometer::agent::auth
+ class { '::ceilometer::db' :
+ database_connection => $ceilometer_database_connection,
}
Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }
include ::heat::api_cloudwatch
include ::heat::engine
+ # Horizon
+ $vhost_params = { add_listen => false }
+ class { 'horizon':
+ cache_server_ip => hiera('memcache_node_ips', '127.0.0.1'),
+ vhost_extra_params => $vhost_params,
+ }
+
$snmpd_user = hiera('snmpd_readonly_user_name')
snmp::snmpv3_user { $snmpd_user:
authtype => 'MD5',