From cdb1ae5fd0057aa6b666ca53fc54e73ce8be19fa Mon Sep 17 00:00:00 2001 From: Michael Gugino Date: Mon, 12 Feb 2018 17:46:24 -0500 Subject: Simplify double upgrade version logic Currently, double upgrade process (3.7 -> 3.9) for control plane attempts to run openshift_version role twice to set the appropriate values for upgrading each major version, 3.8 and 3.9. This commit instructs openshift_version to only inquire about the proper settings for 3.9, and hard-sets the appropriate values for 3.8. This allows a simplification of the openshift_version role, allowing for easier debugging. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1542368 --- playbooks/openshift-master/private/validate_restart.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'playbooks/openshift-master/private/validate_restart.yml') diff --git a/playbooks/openshift-master/private/validate_restart.yml b/playbooks/openshift-master/private/validate_restart.yml index 60b0e5bb6..40aaa653c 100644 --- a/playbooks/openshift-master/private/validate_restart.yml +++ b/playbooks/openshift-master/private/validate_restart.yml @@ -33,6 +33,7 @@ - stat: path="{{ hostvars.localhost.mktemp.stdout }}" register: exists changed_when: false + when: "'stdout' in hostvars.localhost.mktemp" - name: Cleanup temp file on localhost hosts: localhost @@ -41,6 +42,7 @@ tasks: - file: path="{{ hostvars.localhost.mktemp.stdout }}" state=absent changed_when: false + when: "'stdout' in hostvars.localhost.mktemp" - name: Warn if restarting the system where ansible is running hosts: oo_masters_to_config @@ -54,7 +56,9 @@ must be verified manually. To only restart services, set openshift_master_rolling_restart_mode=services in host inventory and relaunch the playbook. - when: exists.stat.exists and openshift.common.rolling_restart_mode == 'system' + when: + - "'stat' in exists" + - exists.stat.exists and openshift.common.rolling_restart_mode == 'system' - set_fact: current_host: "{{ exists.stat.exists }}" when: openshift.common.rolling_restart_mode == 'system' -- cgit v1.2.1