Pass hieradata for internal TLS for RabbitMQ

As with other services, this passes the necessary hieradata to enable
TLS for RabbitMQ. This will mean (once we set it via puppet-tripleo)
that there will only be TLS connections, as the ssl_only option is being
used.

bp tls-via-certmonger

Change-Id: I960bf747cd5e3040f99b28e2fc5873ca3a7472b5
Depends-On: Ic2a7f877745a0a490ddc9315123bd1180b03c514
This commit is contained in:
Juan Antonio Osorio Robles 2016-12-09 15:22:42 +02:00
parent 1f79a5b76c
commit 1992282b88
5 changed files with 123 additions and 46 deletions

View File

@ -2,6 +2,7 @@
# a TLS for in the internal network via certmonger # a TLS for in the internal network via certmonger
parameter_defaults: parameter_defaults:
EnableInternalTLS: true EnableInternalTLS: true
RabbitClientUseSSL: true
# Required for novajoin to enroll the overcloud nodes # Required for novajoin to enroll the overcloud nodes
ServerMetadata: ServerMetadata:
@ -11,6 +12,8 @@ resource_registry:
OS::TripleO::Services::HAProxyInternalTLS: ../puppet/services/haproxy-internal-tls-certmonger.yaml OS::TripleO::Services::HAProxyInternalTLS: ../puppet/services/haproxy-internal-tls-certmonger.yaml
OS::TripleO::Services::ApacheTLS: ../puppet/services/apache-internal-tls-certmonger.yaml OS::TripleO::Services::ApacheTLS: ../puppet/services/apache-internal-tls-certmonger.yaml
OS::TripleO::Services::MySQLTLS: ../puppet/services/database/mysql-internal-tls-certmonger.yaml OS::TripleO::Services::MySQLTLS: ../puppet/services/database/mysql-internal-tls-certmonger.yaml
OS::TripleO::Services::RabbitMQTLS: ../puppet/services/rabbitmq-internal-tls-certmonger.yaml
# We use apache as a TLS proxy # We use apache as a TLS proxy
OS::TripleO::Services::TLSProxyBase: ../puppet/services/apache.yaml OS::TripleO::Services::TLSProxyBase: ../puppet/services/apache.yaml

View File

@ -169,6 +169,7 @@ resource_registry:
OS::TripleO::Services::PacemakerRemote: OS::Heat::None OS::TripleO::Services::PacemakerRemote: OS::Heat::None
OS::TripleO::Services::NeutronSriovAgent: OS::Heat::None OS::TripleO::Services::NeutronSriovAgent: OS::Heat::None
OS::TripleO::Services::RabbitMQ: puppet/services/rabbitmq.yaml OS::TripleO::Services::RabbitMQ: puppet/services/rabbitmq.yaml
OS::TripleO::Services::RabbitMQTLS: OS::Heat::None
OS::TripleO::Services::HAproxy: puppet/services/haproxy.yaml OS::TripleO::Services::HAproxy: puppet/services/haproxy.yaml
OS::TripleO::Services::HAProxyPublicTLS: OS::Heat::None OS::TripleO::Services::HAProxyPublicTLS: OS::Heat::None
OS::TripleO::Services::HAProxyInternalTLS: OS::Heat::None OS::TripleO::Services::HAProxyInternalTLS: OS::Heat::None

View File

@ -68,3 +68,5 @@ outputs:
fi fi
pcs resource update rabbitmq set_policy='ha-all ^(?!amq\\.).* {"ha-mode":"exactly","ha-params":'"$nr_queues}" --wait=600 pcs resource update rabbitmq set_policy='ha-all ^(?!amq\\.).* {"ha-mode":"exactly","ha-params":'"$nr_queues}" --wait=600
when: is_bootstrap_node and migrate_rabbit_ha_mode when: is_bootstrap_node and migrate_rabbit_ha_mode
metadata_settings:
get_attr: [RabbitMQServiceBase, role_data, metadata_settings]

View File

@ -0,0 +1,47 @@
heat_template_version: ocata
description: >
RabbitMQ configurations for using TLS via certmonger.
parameters:
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
# The following parameters are not needed by the template but are
# required to pass the pep8 tests
DefaultPasswords:
default: {}
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
outputs:
role_data:
description: RabbitMQ configurations for using TLS via certmonger.
value:
service_name: rabbitmq_internal_tls_certmonger
config_settings:
generate_service_certificates: true
tripleo::profile::base::rabbitmq::certificate_specs:
service_certificate: '/etc/pki/tls/certs/rabbitmq.crt'
service_key: '/etc/pki/tls/private/rabbitmq.key'
hostname:
str_replace:
template: "%{hiera('fqdn_NETWORK')}"
params:
NETWORK: {get_param: [ServiceNetMap, RabbitmqNetwork]}
principal:
str_replace:
template: "rabbitmq/%{hiera('fqdn_NETWORK')}"
params:
NETWORK: {get_param: [ServiceNetMap, RabbitmqNetwork]}
metadata_settings:
- service: rabbitmq
network: {get_param: [ServiceNetMap, RabbitmqNetwork]}
type: node

View File

@ -48,6 +48,18 @@ parameters:
MonitoringSubscriptionRabbitmq: MonitoringSubscriptionRabbitmq:
default: 'overcloud-rabbitmq' default: 'overcloud-rabbitmq'
type: string type: string
EnableInternalTLS:
type: boolean
default: false
resources:
RabbitMQTLS:
type: OS::TripleO::Services::RabbitMQTLS
properties:
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
outputs: outputs:
role_data: role_data:
@ -56,6 +68,9 @@ outputs:
service_name: rabbitmq service_name: rabbitmq
monitoring_subscription: {get_param: MonitoringSubscriptionRabbitmq} monitoring_subscription: {get_param: MonitoringSubscriptionRabbitmq}
config_settings: config_settings:
map_merge:
- get_attr: [RabbitMQTLS, role_data, config_settings]
-
rabbitmq::file_limit: {get_param: RabbitFDLimit} rabbitmq::file_limit: {get_param: RabbitFDLimit}
rabbitmq::default_user: {get_param: RabbitUserName} rabbitmq::default_user: {get_param: RabbitUserName}
rabbitmq::default_pass: {get_param: RabbitPassword} rabbitmq::default_pass: {get_param: RabbitPassword}
@ -101,6 +116,14 @@ outputs:
# internal_api_subnet - > IP/CIDR # internal_api_subnet - > IP/CIDR
rabbitmq::interface: {get_param: [ServiceNetMap, RabbitmqNetwork]} rabbitmq::interface: {get_param: [ServiceNetMap, RabbitmqNetwork]}
rabbitmq::nr_ha_queues: {get_param: RabbitHAQueues} rabbitmq::nr_ha_queues: {get_param: RabbitHAQueues}
rabbitmq::ssl: {get_param: EnableInternalTLS}
rabbitmq::ssl_port: '5672'
rabbitmq::ssl_depth: 1
rabbitmq::ssl_only: {get_param: EnableInternalTLS}
rabbitmq::ssl_interface: {get_param: [ServiceNetMap, RabbitmqNetwork]}
# TODO(jaosorior): Remove this once we set a proper default in
# puppet-tripleo
tripleo::profile::base::rabbitmq::enable_internal_tls: {get_param: EnableInternalTLS}
step_config: | step_config: |
include ::tripleo::profile::base::rabbitmq include ::tripleo::profile::base::rabbitmq
upgrade_tasks: upgrade_tasks:
@ -110,4 +133,5 @@ outputs:
- name: Start rabbitmq service - name: Start rabbitmq service
tags: step4 tags: step4
service: name=rabbitmq-server state=started service: name=rabbitmq-server state=started
metadata_settings:
get_attr: [RabbitMQTLS, role_data, metadata_settings]