Improve rancher role testability
Move functionality from playbook to rancher role.
Introduce defaults for holding default values in rancher role.
Other small changes noticed while testing rancher role with molecule.
Issue-ID: OOM-1729
Change-Id: I83befa9f0964c67e209d3def76bafd2a61c1ef33
Signed-off-by: Samuli Silvius <s.silvius@partner.samsung.com>
diff --git a/ansible/roles/rancher/tasks/rancher_health.yml b/ansible/roles/rancher/tasks/rancher_health.yml
new file mode 100644
index 0000000..b032373
--- /dev/null
+++ b/ansible/roles/rancher/tasks/rancher_health.yml
@@ -0,0 +1,8 @@
+---
+- name: Check cluster health
+ uri:
+ url: "{{ rancher_server_url }}/v2-beta/projects/{{ k8s_env_id }}"
+ register: env_info
+ retries: 30
+ delay: 15
+ until: "env_info.json.healthState == 'healthy'"