From 95cf33d8b8e9bfeffbf1cc80bf55fc3c603be190 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 12 Feb 2017 19:25:15 +0100 Subject: master, vars/main.yml: define l_is_ha and l_is_same_version Signed-off-by: Giuseppe Scrivano --- roles/openshift_master/tasks/system_container.yml | 24 +++++++++++------------ roles/openshift_master/vars/main.yml | 3 +++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/roles/openshift_master/tasks/system_container.yml b/roles/openshift_master/tasks/system_container.yml index 90cbc243d..a0e1ac75e 100644 --- a/roles/openshift_master/tasks/system_container.yml +++ b/roles/openshift_master/tasks/system_container.yml @@ -17,8 +17,8 @@ changed_when: "'Extracting' in update_result.stdout" when: - ("master" in result.stdout) - - (openshift.common.version is defined) and (openshift.common.version == openshift_version) | bool - - openshift.master.ha is not defined or not openshift.master.ha | bool + - l_is_same_version + - not l_is_ha - name: Uninstall Master system container package command: > @@ -26,15 +26,15 @@ failed_when: False when: - ("master" in result.stdout) - - (openshift.common.version is not defined) or (openshift.common.version != openshift_version) | bool - - openshift.master.ha is not defined or not openshift.master.ha | bool + - not l_is_same_version + - not l_is_ha - name: Install Master system container package command: > atomic install --system --name={{ openshift.common.service_type }}-master {{ openshift.common.system_images_registry }}/{{ openshift.master.master_system_image }}:{{ openshift_image_tag }} when: - - (openshift.common.version is not defined) or (openshift.common.version != openshift_version) or ("master" not in result.stdout) | bool - - openshift.master.ha is not defined or not openshift.master.ha | bool + - not l_is_same_version or ("master" not in result.stdout) | bool + - not l_is_ha notify: - restart master @@ -49,8 +49,8 @@ - controllers when: - ("master" in result.stdout) - - (openshift.common.version is defined) and (openshift.common.version == openshift_version) | bool - - openshift.master.ha is defined and openshift.master.ha | bool + - l_is_same_version + - l_is_ha - name: Uninstall Master HA system container package command: > @@ -61,8 +61,8 @@ - controllers when: - ("master" in result.stdout) - - (openshift.common.version is not defined) or (openshift.common.version != openshift_version) | bool - - openshift.master.ha is defined and openshift.master.ha | bool + - not l_is_same_version + - l_is_ha - name: Install Master HA system container package command: > @@ -71,7 +71,7 @@ - api - controllers when: - - (openshift.common.version is not defined) or (openshift.common.version != openshift_version) or ("master" not in result.stdout) | bool - - openshift.master.ha is defined and openshift.master.ha | bool + - not l_is_same_version or ("master" not in result.stdout) | bool + - l_is_ha notify: - restart master diff --git a/roles/openshift_master/vars/main.yml b/roles/openshift_master/vars/main.yml index 01cd28c66..1e157097d 100644 --- a/roles/openshift_master/vars/main.yml +++ b/roles/openshift_master/vars/main.yml @@ -18,3 +18,6 @@ openshift_master_valid_grant_methods: - auto - prompt - deny + +l_is_ha: "{{ openshift.master.ha is defined and openshift.master.ha | bool }}" +l_is_same_version: "{{ (openshift.common.version is defined) and (openshift.common.version == openshift_version) | bool }}" -- cgit v1.2.3