diff --git a/ci/environments/scenario001-multinode-containers.yaml b/ci/environments/scenario001-multinode-containers.yaml index 62596987c4..0c16d68ea3 100644 --- a/ci/environments/scenario001-multinode-containers.yaml +++ b/ci/environments/scenario001-multinode-containers.yaml @@ -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 diff --git a/ci/environments/scenario001-standalone.yaml b/ci/environments/scenario001-standalone.yaml index 6514fa1a92..6437164a8e 100644 --- a/ci/environments/scenario001-standalone.yaml +++ b/ci/environments/scenario001-standalone.yaml @@ -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 diff --git a/ci/environments/scenario004-standalone.yaml b/ci/environments/scenario004-standalone.yaml index 9f87a9e792..833a217d34 100644 --- a/ci/environments/scenario004-standalone.yaml +++ b/ci/environments/scenario004-standalone.yaml @@ -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 diff --git a/puppet/services/monitoring/sensu-base.yaml b/deployment/monitoring/sensu-base.yaml similarity index 100% rename from puppet/services/monitoring/sensu-base.yaml rename to deployment/monitoring/sensu-base.yaml diff --git a/docker/services/sensu-client.yaml b/deployment/monitoring/sensu-client-container-puppet.yaml similarity index 83% rename from docker/services/sensu-client.yaml rename to deployment/monitoring/sensu-client-container-puppet.yaml index 735c70d396..74527343dc 100644 --- a/docker/services/sensu-client.yaml +++ b/deployment/monitoring/sensu-client-container-puppet.yaml @@ -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]} - diff --git a/environments/computealt.yaml b/environments/computealt.yaml index bb84ea087b..df2833a8e9 100644 --- a/environments/computealt.yaml +++ b/environments/computealt.yaml @@ -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 diff --git a/environments/monitoring-environment.yaml b/environments/monitoring-environment.yaml index 3aaacf9a19..3cf4331dd3 100644 --- a/environments/monitoring-environment.yaml +++ b/environments/monitoring-environment.yaml @@ -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 diff --git a/environments/services-baremetal/sensu-client.yaml b/environments/services-baremetal/sensu-client.yaml index 10ac108326..be83d25da5 100644 --- a/environments/services-baremetal/sensu-client.yaml +++ b/environments/services-baremetal/sensu-client.yaml @@ -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 diff --git a/environments/services/sensu-client.yaml b/environments/services/sensu-client.yaml index c03104d2ff..be83d25da5 100644 --- a/environments/services/sensu-client.yaml +++ b/environments/services/sensu-client.yaml @@ -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 diff --git a/puppet/services/monitoring/sensu-client.yaml b/puppet/services/monitoring/sensu-client.yaml deleted file mode 100644 index 369ec9df62..0000000000 --- a/puppet/services/monitoring/sensu-client.yaml +++ /dev/null @@ -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: []