summaryrefslogtreecommitdiffstats
path: root/roles/openshift_version/tasks/masters_and_nodes.yml
diff options
context:
space:
mode:
authorMichael Gugino <mgugino@redhat.com>2017-12-21 20:17:10 -0500
committerMichael Gugino <mgugino@redhat.com>2018-01-09 11:18:45 -0500
commit54a83bf2b898338c70aeb094c9a0b86b8df8e2d2 (patch)
tree8d41cea271be692a150427ee23d6e26b67d3d8e5 /roles/openshift_version/tasks/masters_and_nodes.yml
parent0e38305063e1b4322425a42a0f5eaaa788d7fb23 (diff)
downloadopenshift-54a83bf2b898338c70aeb094c9a0b86b8df8e2d2.tar.gz
openshift-54a83bf2b898338c70aeb094c9a0b86b8df8e2d2.tar.bz2
openshift-54a83bf2b898338c70aeb094c9a0b86b8df8e2d2.tar.xz
openshift-54a83bf2b898338c70aeb094c9a0b86b8df8e2d2.zip
Refactor version and move some checks into sanity_checks.py
This commit changes how we handle openshift_version role. Most of the version initialization code is only run on the first master now. All other hosts have values set from the master. Aftwards, we run some basic RPM queries to ensure that the correct version is available on the other nodes. Containerized needs to do their own image checks elsewhere.
Diffstat (limited to 'roles/openshift_version/tasks/masters_and_nodes.yml')
-rw-r--r--roles/openshift_version/tasks/masters_and_nodes.yml39
1 files changed, 39 insertions, 0 deletions
diff --git a/roles/openshift_version/tasks/masters_and_nodes.yml b/roles/openshift_version/tasks/masters_and_nodes.yml
new file mode 100644
index 000000000..fbeb22d8b
--- /dev/null
+++ b/roles/openshift_version/tasks/masters_and_nodes.yml
@@ -0,0 +1,39 @@
+---
+# These tasks should only be run against masters and nodes
+
+- block:
+ - name: Check openshift_version for rpm installation
+ include_tasks: check_available_rpms.yml
+ - name: Fail if rpm version and docker image version are different
+ fail:
+ msg: "OCP rpm version {{ openshift_rpm_version }} is different from OCP image version {{ openshift_version }}"
+ # Both versions have the same string representation
+ when: rpm_results.results.versions.available_versions.0 != openshift_version
+ # block when
+ when: not openshift_is_atomic | bool
+
+# We can't map an openshift_release to full rpm version like we can with containers; make sure
+# the rpm version we looked up matches the release requested and error out if not.
+- name: For an RPM install, abort when the release requested does not match the available version.
+ when:
+ - not openshift_is_containerized | bool
+ - openshift_release is defined
+ assert:
+ that:
+ - l_rpm_version.startswith(openshift_release) | bool
+ msg: |-
+ You requested openshift_release {{ openshift_release }}, which is not matched by
+ the latest OpenShift RPM we detected as {{ openshift_service_type }}-{{ l_rpm_version }}
+ on host {{ inventory_hostname }}.
+ We will only install the latest RPMs, so please ensure you are getting the release
+ you expect. You may need to adjust your Ansible inventory, modify the repositories
+ available on the host, or run the appropriate OpenShift upgrade playbook.
+ vars:
+ l_rpm_version: "{{ rpm_results.results.versions.available_versions.0 }}"
+
+# The end result of these three variables is quite important so make sure they are displayed and logged:
+- debug: var=openshift_release
+
+- debug: var=openshift_image_tag
+
+- debug: var=openshift_pkg_version