flatten sensu service configuration

This change combines the previous puppet and docker files
into a single file that performs the docker service installation
and configuration.

Change-Id: Ia41632782a1249cf4e8dcc83040a51510ae8d414
This commit is contained in:
Jill Rouleau 2019-02-11 12:05:10 -07:00
parent 2399828ca1
commit f7bf4efeec
10 changed files with 45 additions and 101 deletions

View File

@ -24,7 +24,7 @@ resource_registry:
# NOTE(mmagr): We need to disable Sensu client deployment for now as the container health check is based
# on successful RabbitMQ connection, which does not happen in this case. We can enable it again when we
# will implement default connection to overcloud RabbitMQ instance,
#OS::TripleO::Services::SensuClient: ../../docker/services/sensu-client.yaml
#OS::TripleO::Services::SensuClient: ../../deployment/monitoring/sensu-client-container-puppet.yaml
# Some infra instances don't pass the ping test but are otherwise working.
# Since the OVB jobs also test this functionality we can shut it off here.
OS::TripleO::AllNodes::Validation: ../common/all-nodes-validation-disabled.yaml

View File

@ -36,7 +36,7 @@ resource_registry:
# NOTE(mmagr): We need to disable Sensu client deployment for now as the container health check is based
# on successful RabbitMQ connection, which does not happen in this case. We can enable it again when we
# will implement default connection to overcloud RabbitMQ instance,
#OS::TripleO::Services::SensuClient: ../../docker/services/sensu-client.yaml
#OS::TripleO::Services::SensuClient: ../../deployment/monitoring/sensu-client-container-puppet.yaml
# Some infra instances don't pass the ping test but are otherwise working.
# Since the OVB jobs also test this functionality we can shut it off here.
OS::TripleO::AllNodes::Validation: ../common/all-nodes-validation-disabled.yaml

View File

@ -28,7 +28,7 @@ resource_registry:
# NOTE(mmagr): We need to disable Sensu client deployment for now as the container health check is based
# on successful RabbitMQ connection, which does not happen in this case. We can enable it again when we
# will implement default connection to overcloud RabbitMQ instance,
#OS::TripleO::Services::SensuClient: ../../docker/services/sensu-client.yaml
#OS::TripleO::Services::SensuClient: ../../deployment/monitoring/sensu-client-container-puppet.yaml
# Some infra instances don't pass the ping test but are otherwise working.
# Since the OVB jobs also test this functionality we can shut it off here.
OS::TripleO::AllNodes::Validation: ../common/all-nodes-validation-disabled.yaml

View File

@ -74,6 +74,19 @@ parameters:
description: CLI tool used to manage containers.
constraints:
- allowed_values: ['docker', 'podman']
AdminPassword:
description: The password for the keystone admin account, used for monitoring, querying neutron etc.
type: string
hidden: true
KeystoneRegion:
default: 'regionOne'
description: Keystone region for endpoint
type: string
SensuClientCustomConfig:
default: {}
description: Hash containing custom sensu-client variables.
type: json
label: Custom configuration for Sensu Client variables
conditions:
docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']}
@ -82,23 +95,36 @@ resources:
ContainersCommon:
type: ./containers-common.yaml
SensuClientBase:
type: ../../puppet/services/monitoring/sensu-client.yaml
SensuBase:
type: ./sensu-base.yaml
properties:
EndpointMap: {get_param: EndpointMap}
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
outputs:
role_data:
description: Role data for the Sensu client role.
value:
service_name: {get_attr: [SensuClientBase, role_data, service_name]}
service_name: sensu_client
config_settings:
map_merge:
- get_attr: [SensuClientBase, role_data, config_settings]
- get_attr: [SensuBase, role_data, config_settings]
- sensu::api: false
sensu::client: true
sensu::server: false
sensu::client_custom:
map_merge:
- {get_param: SensuClientCustomConfig}
- openstack:
username: 'admin'
password: {get_param: AdminPassword}
auth_url: {get_param: [EndpointMap, KeystoneInternal, uri]}
tenant_name: 'admin'
region: {get_param: KeystoneRegion}
- sensu::checks:
check-docker-health:
standalone: true
@ -107,13 +133,12 @@ outputs:
handlers: {get_param: SensuDockerCheckHandlers}
occurrences: {get_param: SensuDockerCheckOccurrences}
refresh: {get_param: SensuDockerCheckRefresh}
service_config_settings: {get_attr: [SensuClientBase, role_data, service_config_settings]}
service_config_settings: {}
# BEGIN DOCKER SETTINGS
puppet_config:
config_volume: sensu
puppet_tags: sensu_rabbitmq_config,sensu_client_config,sensu_check_config,sensu_check
step_config:
get_attr: [SensuClientBase, role_data, step_config]
step_config: include ::tripleo::profile::base::monitoring::sensu
config_image: {get_param: DockerSensuConfigImage}
kolla_config:
/var/lib/kolla/config_files/sensu-client.json:
@ -147,9 +172,11 @@ outputs:
expression: >
switch(bool($.data.cluster) => $.data.cluster, bool($.data.single_node) => $.data.single_node).select($.port).distinct().join(' ')
data:
cluster: {get_attr: [SensuClientBase, role_data, config_settings, 'sensu::rabbitmq_cluster']}
single_node: [{port: {get_attr: [SensuClientBase, role_data, config_settings, 'sensu::rabbitmq_port']}}]
cluster: {get_attr: [SensuBase, role_data, config_settings, 'sensu::rabbitmq_cluster']}
single_node: [{port: {get_attr: [SensuBase, role_data, config_settings, 'sensu::rabbitmq_port']}}]
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-

View File

@ -13,7 +13,7 @@ resource_registry:
OS::TripleO::Services::NovaMigrationTargetAlt: ../deployment/nova/nova-migration-target-container-puppet.yaml
OS::TripleO::Services::SensuClientAlt: OS::Heat::None
# If enabling monitoring you'll need provide the following in a specific resource_registry
# OS::TripleO::Services::SensuClientAlt: ../puppet/services/monitoring/sensu-client.yaml
# OS::TripleO::Services::SensuClientAlt: ../deployment/monitoring/sensu-client-container-puppet.yaml
OS::TripleO::Services::OVNControllerAlt: OS::Heat::None
# If enabling OVN you'll need provide the following in a specific resource_registry
# OS::TripleO::Services::OVNControllerAlt: ../puppet/services/ovn-controller.yaml

View File

@ -1,7 +1,7 @@
## A Heat environment file which can be used to set up monitoring agents
resource_registry:
OS::TripleO::Services::SensuClient: ../docker/services/sensu-client.yaml
OS::TripleO::Services::SensuClient: ../deployment/monitoring/sensu-client-container-puppet.yaml
#parameter_defaults:
# MonitoringRabbitHost: 10.10.10.10

View File

@ -1,3 +1,3 @@
resource_registry:
OS::TripleO::Services::SensuClient: ../../puppet/services/monitoring/sensu-client.yaml
OS::TripleO::Services::SensuClient: ../../deployment/monitoring/sensu-client-container-puppet.yaml

View File

@ -1,3 +1,3 @@
resource_registry:
OS::TripleO::Services::SensuClient: ../../docker/services/sensu-client.yaml
OS::TripleO::Services::SensuClient: ../../deployment/monitoring/sensu-client-container-puppet.yaml

View File

@ -1,83 +0,0 @@
heat_template_version: rocky
description: >
Sensu client configured with Puppet.
This service is deprecated and will be removed in future releases.
parameters:
ServiceData:
default: {}
description: Dictionary packing service data
type: json
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
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
EndpointMap:
default: {}
description: >
Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
AdminPassword:
description: The password for the keystone admin account, used for monitoring, querying neutron etc.
type: string
hidden: true
KeystoneRegion:
default: 'regionOne'
description: Keystone region for endpoint
type: string
SensuClientCustomConfig:
default: {}
description: Hash containing custom sensu-client variables.
type: json
label: Custom configuration for Sensu Client variables
resources:
SensuBase:
type: ./sensu-base.yaml
properties:
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
outputs:
role_data:
description: Role data for the Sensu client role.
value:
service_name: sensu_client
monitoring_subscription: all
config_settings:
map_merge:
- get_attr: [SensuBase, role_data, config_settings]
- sensu::api: false
sensu::client: true
sensu::server: false
sensu::client_custom:
map_merge:
- {get_param: SensuClientCustomConfig}
- openstack:
username: 'admin'
password: {get_param: AdminPassword}
auth_url: {get_param: [EndpointMap, KeystoneInternal, uri]}
tenant_name: 'admin'
region: {get_param: KeystoneRegion}
step_config: |
include ::tripleo::profile::base::monitoring::sensu
upgrade_tasks: []