diff options
author | Jan Chaloupka <jchaloup@redhat.com> | 2017-03-01 12:54:19 +0100 |
---|---|---|
committer | Jan Chaloupka <jchaloup@redhat.com> | 2017-03-07 22:27:48 +0100 |
commit | 1a16667b6a2e99ca6dc6b83c5794fb9995501280 (patch) | |
tree | 3427f0f326a307bf2b63e16c8fb5c1f887731712 /playbooks/common/openshift-cluster/upgrades | |
parent | 6ecb86b2fcc36e3383d86395d3be0a443e12981e (diff) | |
download | openshift-1a16667b6a2e99ca6dc6b83c5794fb9995501280.tar.gz openshift-1a16667b6a2e99ca6dc6b83c5794fb9995501280.tar.bz2 openshift-1a16667b6a2e99ca6dc6b83c5794fb9995501280.tar.xz openshift-1a16667b6a2e99ca6dc6b83c5794fb9995501280.zip |
- update excluders to latest, in non-upgrade scenarios do not update
- check both available excluder versions are at most of upgrade target version
- get excluder status through status command
- make excluders enablement configurable
Diffstat (limited to 'playbooks/common/openshift-cluster/upgrades')
-rw-r--r-- | playbooks/common/openshift-cluster/upgrades/disable_excluder.yml | 21 | ||||
-rw-r--r-- | playbooks/common/openshift-cluster/upgrades/pre/validate_excluder.yml | 22 |
2 files changed, 43 insertions, 0 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/disable_excluder.yml b/playbooks/common/openshift-cluster/upgrades/disable_excluder.yml new file mode 100644 index 000000000..2a85dc92e --- /dev/null +++ b/playbooks/common/openshift-cluster/upgrades/disable_excluder.yml @@ -0,0 +1,21 @@ +--- +- name: Record excluder state and disable + hosts: l_oo_all_hosts + gather_facts: no + tasks: + - include: pre/validate_excluder.yml + vars: + #repoquery_cmd: repoquery_cmd + #openshift_upgrade_target: openshift_upgrade_target + excluder: "{{ item }}" + with_items: + - "{{ openshift.common.service_type }}-docker-excluder" + - "{{ openshift.common.service_type }}-excluder" + + # disable excluders based on their status + - include_role: + name: openshift_excluder + tasks_from: disable + vars: + openshift_excluder_package_state: latest + docker_excluder_package_state: latest diff --git a/playbooks/common/openshift-cluster/upgrades/pre/validate_excluder.yml b/playbooks/common/openshift-cluster/upgrades/pre/validate_excluder.yml new file mode 100644 index 000000000..5078638b7 --- /dev/null +++ b/playbooks/common/openshift-cluster/upgrades/pre/validate_excluder.yml @@ -0,0 +1,22 @@ +--- +# input variables: +# - repoquery_cmd +# - excluder +# - openshift_upgrade_target +- name: Get available excluder version + command: > + {{ repoquery_cmd }} --qf '%{version}' "{{ excluder }}" + register: excluder_version + failed_when: false + changed_when: false + +- name: Docker excluder version detected + debug: + msg: "{{ excluder }}: {{ excluder_version.stdout }}" + +- name: Check the available {{ excluder }} version is at most of the upgrade target version + fail: + msg: "Available {{ excluder }} version {{ excluder_version.stdout }} is higher than the upgrade target version {{ openshift_upgrade_target }}" + when: + - "{{ excluder_version.stdout != '' }}" + - "{{ excluder_version.stdout.split('.')[0:2] | join('.') | version_compare(openshift_upgrade_target, '>', strict=True) }}" |