From f4c304dcca60b8dbbbcf3c67247ca5b4a227aea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 12 Apr 2023 19:26:39 +0200 Subject: [PATCH] consul: add more variables for healcheck parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- defaults/main.yml | 5 +++++ tasks/consul.yml | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index b5f39cf..456ea3c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -62,3 +62,8 @@ nimbus_fluffy_consul_service_name: 'nimbus-fluffy' nimbus_fluffy_consul_service_file_name: '{{ nimbus_fluffy_service_name | replace("-", "_") }}' nimbus_fluffy_consul_metrics_service_name: '{{ nimbus_fluffy_consul_service_name }}-metrics' nimbus_fluffy_consul_url: 'http://localhost:8500/v1/catalog' +nimbus_fluffy_consul_check_interval: '60s' +nimbus_fluffy_consul_check_timeout: '5s' +nimbus_fluffy_consul_success_before_passing: 0 +nimbus_fluffy_consul_failures_before_warning: 1 +nimbus_fluffy_consul_failures_before_critical: 2 diff --git a/tasks/consul.yml b/tasks/consul.yml index 4115796..9bde41e 100644 --- a/tasks/consul.yml +++ b/tasks/consul.yml @@ -31,7 +31,11 @@ - name: '{{ nimbus_fluffy_consul_service_name }}-health' type: 'script' script: '{{ nimbus_fluffy_rpc_script_path }} discv5_nodeInfo' - timeout: '5s' + interval: '{{ nimbus_fluffy_consul_check_interval }}' + timeout: '{{ nimbus_fluffy_consul_check_timeout }}' + success_before_passing: '{{ nimbus_fluffy_consul_success_before_passing }}' + failures_before_warning: '{{ nimbus_fluffy_consul_failures_before_warning }}' + failures_before_critical: '{{ nimbus_fluffy_consul_failures_before_critical }}' - id: '{{ nimbus_fluffy_service_name }}-metrics' name: '{{ nimbus_fluffy_consul_metrics_service_name }}' @@ -44,3 +48,8 @@ - name: '{{ nimbus_fluffy_consul_metrics_service_name }}-health' type: 'http' http: 'http://localhost:{{ nimbus_fluffy_metrics_port }}/health' + interval: '{{ nimbus_fluffy_consul_check_interval }}' + timeout: '{{ nimbus_fluffy_consul_check_timeout }}' + success_before_passing: '{{ nimbus_fluffy_consul_success_before_passing }}' + failures_before_warning: '{{ nimbus_fluffy_consul_failures_before_warning }}' + failures_before_critical: '{{ nimbus_fluffy_consul_failures_before_critical }}'