From 0b60201a1eb3a72161ef3e2c82ababd50f1af1ce Mon Sep 17 00:00:00 2001
From: Peter Lee
Date: Tue, 24 Oct 2017 23:10:56 +0800
Subject: [PATCH] fix etcd health check bug (#1480)
---
roles/vault/tasks/shared/check_etcd.yml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/roles/vault/tasks/shared/check_etcd.yml b/roles/vault/tasks/shared/check_etcd.yml
index 20b505eac..6158a3126 100644
--- a/roles/vault/tasks/shared/check_etcd.yml
+++ b/roles/vault/tasks/shared/check_etcd.yml
@@ -4,6 +4,7 @@
uri:
url: "{{ vault_etcd_url }}/health"
validate_certs: no
+ return_content: yes
until: vault_etcd_health_check.status == 200 or vault_etcd_health_check.status == 401
retries: 10
delay: 2
@@ -14,7 +15,9 @@
- name: check_etcd | Set fact based off the etcd_health_check response
set_fact:
- vault_etcd_available: "{{ vault_etcd_health_check.get('json', {}).get('health')|bool }}"
+ vault_etcd_available: "{{ vault_etcd_health_check.content }}"
+- set_fact:
+ vault_etcd_available: "{{ vault_etcd_available.health|d()|bool }}"
- name: check_etcd | Fail if etcd is not available and needed
fail: