diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/glance/nfs_mount.pp | 80 | ||||
-rw-r--r-- | manifests/haproxy.pp | 2 | ||||
-rw-r--r-- | manifests/profile/base/aodh/api.pp | 58 | ||||
-rw-r--r-- | manifests/profile/base/ceilometer/api.pp | 55 | ||||
-rw-r--r-- | manifests/profile/base/cinder/api.pp | 4 | ||||
-rw-r--r-- | manifests/profile/base/glance/api.pp | 17 | ||||
-rw-r--r-- | manifests/profile/base/haproxy.pp | 2 | ||||
-rw-r--r-- | manifests/profile/base/zaqar.pp | 19 |
8 files changed, 222 insertions, 15 deletions
diff --git a/manifests/glance/nfs_mount.pp b/manifests/glance/nfs_mount.pp new file mode 100644 index 0000000..035191d --- /dev/null +++ b/manifests/glance/nfs_mount.pp @@ -0,0 +1,80 @@ +# Copyright 2016 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# == Class: tripleo::glance::nfs_mount +# +# NFS mount for Glance image storage file backend +# +# === Parameters +# +# [*share*] +# NFS share to mount, in 'IP:PATH' format. +# +# [*options*] +# (Optional) NFS mount options. Defaults to +# 'intr,context=system_u:object_r:glance_var_lib_t:s0' +# +# [*edit_fstab*] +# (Optional) Whether to persist the mount info to fstab. +# Defaults to true. +# +# [*fstab_fstype*] +# (Optional) File system type to use in fstab for the mount. +# Defaults to 'nfs4'. +# +# [*fstab_prepend_options*] +# (Optional) Extra mount options for fstab (prepended to $options). +# Defaults to 'bg', so that a potentially failed mount doesn't +# prevent the machine from booting. +# +class tripleo::glance::nfs_mount ( + $share, + $options = 'intr,context=system_u:object_r:glance_var_lib_t:s0', + $edit_fstab = true, + $fstab_fstype = 'nfs4', + $fstab_prepend_options = 'bg' +) { + + $images_dir = '/var/lib/glance/images' + + if $options and $options != '' { + $options_part = "-o ${options}" + } else { + $options_part = '' + } + + if $fstab_prepend_options and $fstab_prepend_options != '' { + $fstab_prepend_part = "${fstab_prepend_options}," + } else { + $fstab_prepend_part = '' + } + + file { $images_dir: + ensure => directory, + } -> + exec { 'NFS mount for glance file backend': + path => ['/usr/sbin', '/usr/bin'], + command => "mount -t nfs '${share}' '${images_dir}' ${options_part}", + unless => "mount | grep ' ${images_dir} '", + } + + if $edit_fstab { + file_line { 'NFS for glance in fstab': + ensure => present, + line => "${share} ${images_dir} ${fstab_fstype} ${fstab_prepend_part}${options} 0 0", + match => " ${images_dir} ", + path => '/etc/fstab', + } + } +} diff --git a/manifests/haproxy.pp b/manifests/haproxy.pp index 39d606d..496581e 100644 --- a/manifests/haproxy.pp +++ b/manifests/haproxy.pp @@ -905,6 +905,7 @@ class tripleo::haproxy ( server_names => hiera('ceilometer_api_node_names', $controller_hosts_names_real), public_ssl_port => $ports[ceilometer_api_ssl_port], service_network => $ceilometer_network, + member_options => union($haproxy_member_options, $internal_tls_member_options), } } @@ -917,6 +918,7 @@ class tripleo::haproxy ( server_names => hiera('aodh_api_node_names', $controller_hosts_names_real), public_ssl_port => $ports[aodh_api_ssl_port], service_network => $aodh_network, + member_options => union($haproxy_member_options, $internal_tls_member_options), } } diff --git a/manifests/profile/base/aodh/api.pp b/manifests/profile/base/aodh/api.pp index 2dcf802..06dcfe5 100644 --- a/manifests/profile/base/aodh/api.pp +++ b/manifests/profile/base/aodh/api.pp @@ -18,6 +18,35 @@ # # === Parameters # +# [*aodh_network*] +# (Optional) The network name where the aodh endpoint is listening on. +# This is set by t-h-t. +# Defaults to hiera('aodh_api_network', undef) +# +# [*certificates_specs*] +# (Optional) The specifications to give to certmonger for the certificate(s) +# it will create. +# Example with hiera: +# apache_certificates_specs: +# httpd-internal_api: +# hostname: <overcloud controller fqdn> +# service_certificate: <service certificate path> +# service_key: <service key path> +# principal: "haproxy/<overcloud controller fqdn>" +# Defaults to hiera('apache_certificate_specs', {}). +# +# [*enable_internal_tls*] +# (Optional) Whether TLS in the internal network is enabled or not. +# Defaults to hiera('enable_internal_tls', false) +# +# [*generate_service_certificates*] +# (Optional) Whether or not certmonger will generate certificates for +# HAProxy. This could be as many as specified by the $certificates_specs +# variable. +# Note that this doesn't configure the certificates in haproxy, it merely +# creates the certificates. +# Defaults to hiera('generate_service_certificate', false). +# # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. @@ -29,15 +58,38 @@ # class tripleo::profile::base::aodh::api ( - $step = hiera('step'), - $enable_combination_alarms = false, + $aodh_network = hiera('aodh_api_network', undef), + $certificates_specs = hiera('apache_certificates_specs', {}), + $enable_internal_tls = hiera('enable_internal_tls', false), + $generate_service_certificates = hiera('generate_service_certificates', false), + $step = hiera('step'), + $enable_combination_alarms = false, ) { include ::tripleo::profile::base::aodh + if $enable_internal_tls { + if $generate_service_certificates { + ensure_resources('tripleo::certmonger::httpd', $certificates_specs) + } + + if !$aodh_network { + fail('aodh_api_network is not set in the hieradata.') + } + $tls_certfile = $certificates_specs["httpd-${aodh_network}"]['service_certificate'] + $tls_keyfile = $certificates_specs["httpd-${aodh_network}"]['service_key'] + } else { + $tls_certfile = undef + $tls_keyfile = undef + } + + if $step >= 4 { include ::aodh::api - include ::aodh::wsgi::apache + class { '::aodh::wsgi::apache': + ssl_cert => $tls_certfile, + ssl_key => $tls_keyfile, + } #NOTE: Combination alarms are deprecated in newton and disabled by default. # we need a way to override this setting for users still using this type diff --git a/manifests/profile/base/ceilometer/api.pp b/manifests/profile/base/ceilometer/api.pp index da94da2..6ef4748 100644 --- a/manifests/profile/base/ceilometer/api.pp +++ b/manifests/profile/base/ceilometer/api.pp @@ -18,18 +18,69 @@ # # === Parameters # +# [*ceilometer_network*] +# (Optional) The network name where the ceilometer endpoint is listening on. +# This is set by t-h-t. +# Defaults to hiera('ceilometer_api_network', undef) +# +# [*certificates_specs*] +# (Optional) The specifications to give to certmonger for the certificate(s) +# it will create. +# Example with hiera: +# apache_certificates_specs: +# httpd-internal_api: +# hostname: <overcloud controller fqdn> +# service_certificate: <service certificate path> +# service_key: <service key path> +# principal: "haproxy/<overcloud controller fqdn>" +# Defaults to hiera('apache_certificate_specs', {}). +# +# [*enable_internal_tls*] +# (Optional) Whether TLS in the internal network is enabled or not. +# Defaults to hiera('enable_internal_tls', false) +# +# [*generate_service_certificates*] +# (Optional) Whether or not certmonger will generate certificates for +# HAProxy. This could be as many as specified by the $certificates_specs +# variable. +# Note that this doesn't configure the certificates in haproxy, it merely +# creates the certificates. +# Defaults to hiera('generate_service_certificate', false). +# # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. # Defaults to hiera('step') # class tripleo::profile::base::ceilometer::api ( - $step = hiera('step'), + $ceilometer_network = hiera('ceilometer_api_network', undef), + $certificates_specs = hiera('apache_certificates_specs', {}), + $enable_internal_tls = hiera('enable_internal_tls', false), + $generate_service_certificates = hiera('generate_service_certificates', false), + $step = hiera('step'), ) { include ::tripleo::profile::base::ceilometer + if $enable_internal_tls { + if $generate_service_certificates { + ensure_resources('tripleo::certmonger::httpd', $certificates_specs) + } + + if !$ceilometer_network { + fail('ceilometer_api_network is not set in the hieradata.') + } + $tls_certfile = $certificates_specs["httpd-${ceilometer_network}"]['service_certificate'] + $tls_keyfile = $certificates_specs["httpd-${ceilometer_network}"]['service_key'] + } else { + $tls_certfile = undef + $tls_keyfile = undef + } + if $step >= 4 { include ::ceilometer::api - include ::ceilometer::wsgi::apache + class { '::ceilometer::wsgi::apache': + ssl_cert => $tls_certfile, + ssl_key => $tls_keyfile, + } } } diff --git a/manifests/profile/base/cinder/api.pp b/manifests/profile/base/cinder/api.pp index fa6574d..8fcc7d6 100644 --- a/manifests/profile/base/cinder/api.pp +++ b/manifests/profile/base/cinder/api.pp @@ -40,9 +40,7 @@ class tripleo::profile::base::cinder::api ( include ::tripleo::profile::base::cinder if $step >= 4 or ($step >= 3 and $sync_db) { - class { '::cinder::api': - service_name => 'httpd' - } + include ::cinder::api include ::cinder::wsgi::apache include ::cinder::ceilometer include ::cinder::glance diff --git a/manifests/profile/base/glance/api.pp b/manifests/profile/base/glance/api.pp index f3db396..a7d4487 100644 --- a/manifests/profile/base/glance/api.pp +++ b/manifests/profile/base/glance/api.pp @@ -22,6 +22,10 @@ # (Optional) Glance backend(s) to use. # Defaults to downcase(hiera('glance_backend', 'swift')) # +# [*glance_nfs_enabled*] +# (Optional) Whether to use NFS mount as 'file' backend storage location. +# Defaults to false +# # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. @@ -36,12 +40,17 @@ # Defaults to hiera('glance::notify::rabbitmq::rabbit_port', 5672) class tripleo::profile::base::glance::api ( - $glance_backend = downcase(hiera('glance_backend', 'swift')), - $step = hiera('step'), - $rabbit_hosts = hiera('rabbitmq_node_ips', undef), - $rabbit_port = hiera('glance::notify::rabbitmq::rabbit_port', 5672), + $glance_backend = downcase(hiera('glance_backend', 'swift')), + $glance_nfs_enabled = false, + $step = hiera('step'), + $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $rabbit_port = hiera('glance::notify::rabbitmq::rabbit_port', 5672), ) { + if $step >= 1 and $glance_nfs_enabled { + include ::tripleo::glance::nfs_mount + } + if $step >= 4 { case $glance_backend { 'swift': { $backend_store = 'glance.store.swift.Store' } diff --git a/manifests/profile/base/haproxy.pp b/manifests/profile/base/haproxy.pp index afeb8c0..f16ec1b 100644 --- a/manifests/profile/base/haproxy.pp +++ b/manifests/profile/base/haproxy.pp @@ -95,7 +95,7 @@ class tripleo::profile::base::haproxy ( command => 'systemctl reload haproxy', path => ['/usr/bin', '/usr/sbin'], refreshonly => true, - onlyif => 'pcs property | grep -q "maintenance-mode.*true"', + onlyif => 'systemctl is-active haproxy | grep -q active', subscribe => Class['::haproxy'] } Haproxy::Listen<||> ~> Exec['haproxy-reload'] diff --git a/manifests/profile/base/zaqar.pp b/manifests/profile/base/zaqar.pp index 6794742..89a03ad 100644 --- a/manifests/profile/base/zaqar.pp +++ b/manifests/profile/base/zaqar.pp @@ -32,8 +32,23 @@ class tripleo::profile::base::zaqar ( ) { if $step >= 4 { include ::zaqar - include ::zaqar::management::mongodb - include ::zaqar::messaging::mongodb + + if str2bool(hiera('mongodb::server::ipv6', false)) { + $mongo_node_ips_with_port_prefixed = prefix(hiera('mongodb_node_ips'), '[') + $mongo_node_ips_with_port = suffix($mongo_node_ips_with_port_prefixed, ']:27017') + } else { + $mongo_node_ips_with_port = suffix(hiera('mongodb_node_ips'), ':27017') + } + $mongodb_replset = hiera('mongodb::server::replset') + $mongo_node_string = join($mongo_node_ips_with_port, ',') + $database_connection = "mongodb://${mongo_node_string}/zaqar?replicaSet=${mongodb_replset}" + + class { '::zaqar::management::mongodb': + uri => $database_connection, + } + class {'::zaqar::messaging::mongodb': + uri => $database_connection, + } include ::zaqar::transport::websocket include ::zaqar::transport::wsgi |