From 47793924c92be3ec8cbe3f72747fb424a9af48a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=A1gr?= Date: Fri, 16 Feb 2018 13:27:42 +0100 Subject: [PATCH] Use sensu-client healthcheck parameter This patch adds possibility to pass non-standard ports of monitoring RabbitMQ instance to sensu-client container health check Change-Id: Icc01ce23b3fc538811b4dfc4fbaba18dc7165f89 --- docker/services/sensu-client.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docker/services/sensu-client.yaml b/docker/services/sensu-client.yaml index de787c122d..cecd5694d4 100644 --- a/docker/services/sensu-client.yaml +++ b/docker/services/sensu-client.yaml @@ -68,8 +68,8 @@ parameters: description: The number of seconds sensu-plugin-aware handlers should wait before taking second action. default: 90 -resources: +resources: ContainersCommon: type: ./containers-common.yaml @@ -81,6 +81,7 @@ resources: ServiceNetMap: {get_param: ServiceNetMap} DefaultPasswords: {get_param: DefaultPasswords} + outputs: role_data: description: Role data for the Sensu client role. @@ -129,7 +130,16 @@ outputs: user: root restart: always healthcheck: - test: /openstack/healthcheck + test: + list_join: + - ' ' + - - '/openstack/healthcheck' + - yaql: + 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']}}] volumes: list_concat: - {get_attr: [ContainersCommon, volumes]}