Add j2 per-role MetricsQdrNetwork

Allow the MetricsQdrNetwork to vary by role. This is needed
as the CephStorage, BlockStorage, and ObjectStorage roles need
to use the storage network, while other roles need internal_api.

Change-Id: I37611d516495b2b82b56a08df8b6ac38e0687083
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
This commit is contained in:
Ryan McCabe 2020-02-27 23:06:11 -05:00
parent 340a6a6d70
commit 0b2441cdc9
7 changed files with 64 additions and 27 deletions

View File

@ -139,7 +139,13 @@ outputs:
template:
"%{hiera('$NETWORK')}"
params:
$NETWORK: {get_param: [ServiceNetMap, MetricsQdrNetwork]}
$NETWORK:
get_param:
- ServiceNetMap
- str_replace:
template: "ROLENAMEMetricsQdrNetwork"
params:
ROLENAME: {get_param: RoleName}
tripleo::profile::base::ceilometer::agent::notification::notifier_host_port: {get_param: MetricsQdrPort}
- {}
service_config_settings:

View File

@ -461,7 +461,13 @@ outputs:
template:
"%{hiera('$NETWORK')}"
params:
$NETWORK: {get_param: [ServiceNetMap, MetricsQdrNetwork]}
$NETWORK:
get_param:
- ServiceNetMap
- str_replace:
template: "ROLENAMEMetricsQdrNetwork"
params:
ROLENAME: {get_param: RoleName}
tripleo::profile::base::metrics::collectd::amqp_port:
get_param: MetricsQdrPort
tripleo::profile::base::metrics::collectd::amqp_user:
@ -578,12 +584,24 @@ outputs:
str_replace:
template: "%{hiera('fqdn_NETWORK')}"
params:
NETWORK: {get_param: [ServiceNetMap, MetricsQdrNetwork]}
NETWORK:
get_param:
- ServiceNetMap
- str_replace:
template: "ROLENAMEMetricsQdrNetwork"
params:
ROLENAME: {get_param: RoleName}
tripleo::profile::base::metrics::collectd::sensubility::client_address:
str_replace:
template: "%{hiera('NETWORK')}"
params:
NETWORK: {get_param: [ServiceNetMap, MetricsQdrNetwork]}
NETWORK:
get_param:
- ServiceNetMap
- str_replace:
template: "ROLENAMEMetricsQdrNetwork"
params:
ROLENAME: {get_param: RoleName}
tripleo::profile::base::metrics::collectd::sensubility::keepalive_interval:
get_param: CollectdSensubilityKeepaliveInterval
tripleo::profile::base::metrics::collectd::sensubility::tmp_base_dir:

View File

@ -182,7 +182,13 @@ outputs:
template:
"%{hiera('$NETWORK')}"
params:
$NETWORK: {get_param: [ServiceNetMap, MetricsQdrNetwork]}
$NETWORK:
get_param:
- ServiceNetMap
- str_replace:
template: "ROLENAMEMetricsQdrNetwork"
params:
ROLENAME: {get_param: RoleName}
tripleo::profile::base::metrics::qdr::listen_on_external: {get_param: MetricsQdrExternalEndpoint}
tripleo::profile::base::metrics::qdr::listener_port: {get_param: MetricsQdrPort}
tripleo::profile::base::metrics::qdr::username: {get_param: MetricsQdrUsername}
@ -216,12 +222,24 @@ outputs:
str_replace:
template: "%{hiera('fqdn_NETWORK')}"
params:
NETWORK: {get_param: [ServiceNetMap, MetricsQdrNetwork]}
NETWORK:
get_param:
- ServiceNetMap
- str_replace:
template: "ROLENAMEMetricsQdrNetwork"
params:
ROLENAME: {get_param: RoleName}
principal:
str_replace:
template: "metrics-qdr/%{hiera('fqdn_NETWORK')}"
params:
NETWORK: {get_param: [ServiceNetMap, MetricsQdrNetwork]}
NETWORK:
get_param:
- ServiceNetMap
- str_replace:
template: "ROLENAMEMetricsQdrNetwork"
params:
ROLENAME: {get_param: RoleName}
tripleo::profile::base::metrics::qdr::ssl_profiles:
list_concat:
- get_param: MetricsQdrSSLProfiles
@ -235,7 +253,13 @@ outputs:
- internal_tls_enabled
-
- service: metrics-qdr
network: {get_param: [ServiceNetMap, MetricsQdrNetwork]}
network:
get_param:
- ServiceNetMap
- str_replace:
template: "ROLENAMEMetricsQdrNetwork"
params:
ROLENAME: {get_param: RoleName}
type: node
- null
# BEGIN DOCKER SETTINGS

View File

@ -14,9 +14,3 @@ parameter_defaults:
telemetry:
format: JSON
presettle: true
BlockStorageExtraConfig:
tripleo::profile::base::metrics::collectd::amqp_host: "%{hiera(hiera('block_storage_hostname_resolve_network'))}"
CephStorageExtraConfig:
tripleo::profile::base::metrics::collectd::amqp_host: "%{hiera(hiera('ceph_storage_hostname_resolve_network'))}"
ObjectStorageExtraConfig:
tripleo::profile::base::metrics::collectd::amqp_host: "%{hiera(hiera('object_storage_hostname_resolve_network'))}"

View File

@ -10,12 +10,6 @@ parameter_defaults:
ExtraConfig:
tripleo::profile::base::metrics::qdr::interior_mesh_nodes: ''
tripleo::profile::base::metrics::qdr::router_mode: edge
BlockStorageExtraConfig:
tripleo::profile::base::metrics::qdr::listener_addr: "%{hiera(hiera('block_storage_hostname_resolve_network'))}"
CephStorageExtraConfig:
tripleo::profile::base::metrics::qdr::listener_addr: "%{hiera(hiera('ceph_storage_hostname_resolve_network'))}"
ObjectStorageExtraConfig:
tripleo::profile::base::metrics::qdr::listener_addr: "%{hiera(hiera('object_storage_hostname_resolve_network'))}"
#MetricsQdrConnectors:
# - host: qdr-normal-sa-telemetry.apps.remote.tld
# port: 443

View File

@ -11,12 +11,6 @@ resource_registry:
parameter_defaults:
ControllerExtraConfig:
tripleo::profile::base::metrics::qdr::router_mode: interior
BlockStorageExtraConfig:
tripleo::profile::base::metrics::qdr::listener_addr: "%{hiera(hiera('block_storage_hostname_resolve_network'))}"
CephStorageExtraConfig:
tripleo::profile::base::metrics::qdr::listener_addr: "%{hiera(hiera('ceph_storage_hostname_resolve_network'))}"
ObjectStorageExtraConfig:
tripleo::profile::base::metrics::qdr::listener_addr: "%{hiera(hiera('object_storage_hostname_resolve_network'))}"
#MetricsQdrConnectors:
# - host: qdr-normal-sa-telemetry.apps.remote.tld
# port: 443

View File

@ -48,7 +48,6 @@ parameters:
KeystoneAdminApiNetwork: ctlplane # allows undercloud to config endpoints
KeystonePublicApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
ManilaApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
MetricsQdrNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
NeutronApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
OctaviaApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
HeatApiNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
@ -98,6 +97,14 @@ parameters:
{%- for role in roles if not role.name.startswith('Ceph') %}
{{role.name}}HostnameResolveNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
{%- endfor %}
# special-case for MetricsQdrNetwork, which will vary depending on role
{%- for role in roles if role.name == 'CephStorage' or role.name == 'BlockStorage' or role.name == 'ObjectStorage' %}
{{role.name}}MetricsQdrNetwork: {{ _service_nets.get('storage', 'ctlplane') }}
{%- endfor %}
{%- for role in roles if role.name != 'CephStorage' and role.name != 'BlockStorage' and role.name != 'ObjectStorage' %}
{{role.name}}MetricsQdrNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }}
{%- endfor %}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry.
type: json