Skip to content

Commit

Permalink
Merge pull request #90 from idealista/develop
Browse files Browse the repository at this point in the history
Release 1.9.2
  • Loading branch information
blalop authored Sep 29, 2022
2 parents 553940f + 4cba840 commit dc8a314
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch

## Unreleased

## [1.9.2](https://github.com/idealista/consul_role/tree/1.9.2) (2022-09-29)
### [Full Changelog](https://github.com/idealista/consul_role/compare/1.9.1...1.9.2)
### Fixed
- *[#84](https://github.com/idealista/consul_role/issues/84) omit timeout if none is provided* @blalop


## [1.9.1](https://github.com/idealista/consul_role/tree/1.9.1) (2022-09-28)
Expand Down
5 changes: 4 additions & 1 deletion molecule/default/group_vars/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ consul_ui: true
consul_enable_script_check: true

consul_services_register:
- name: node exporter http home
port: 9100
http: "http://localhost:9100"
interval: "60s"
- name: node exporter http
port: 9100
http: "http://localhost:9100/metrics"
Expand All @@ -15,4 +19,3 @@ consul_services_register:
- name: node exporter script
script: "pidof node_exporter"
interval: "60s"
timeout: 1
9 changes: 5 additions & 4 deletions tasks/service_healthcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
block:
- name: Consul | Check that web server is available
vars:
timeout_unit: "{{ item.timeout[-1] }}"
timeout: "{{ item.timeout | default(omit) }}"
timeout_unit: "{{ timeout[-1] }}"
timeout_has_suffix: "{{ timeout_unit in ['s', 'm'] }}"
timeout_seconds: "{{ item.timeout[:-1] }}"
timeout_minutes: "{{ item.timeout[:-1] | int * 60 }}"
timeout_seconds: "{{ timeout[:-1] }}"
timeout_minutes: "{{ timeout[:-1] | int * 60 }}"
uri:
url: "{{ item.http }}"
timeout: "{{ (item.timeout if not timeout_has_suffix else (timeout_seconds if timeout_unit == 's' else timeout_minutes)) | default(omit) }}"
timeout: "{{ (timeout if not timeout_has_suffix else (timeout_seconds if timeout_unit == 's' else timeout_minutes)) }}"
return_content: no
status_code: 200
when: "item.http is defined"
Expand Down

0 comments on commit dc8a314

Please sign in to comment.