summaryrefslogtreecommitdiffstats
path: root/roles/openshift_version/tasks/first_master_rpm_version.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/first_master_rpm_version.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/first_master_rpm_version.yml')
-rw-r--r--roles/openshift_version/tasks/first_master_rpm_version.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/openshift_version/tasks/first_master_rpm_version.yml b/roles/openshift_version/tasks/first_master_rpm_version.yml
new file mode 100644
index 000000000..264baca65
--- /dev/null
+++ b/roles/openshift_version/tasks/first_master_rpm_version.yml
@@ -0,0 +1,16 @@
+---
+- name: Set rpm version to configure if openshift_pkg_version specified
+ set_fact:
+ # Expects a leading "-" in inventory, strip it off here, and remove trailing release,
+ openshift_version: "{{ openshift_pkg_version[1:].split('-')[0] }}"
+ when:
+ - openshift_pkg_version is defined
+ - openshift_version is not defined
+
+# These tasks should only be run against masters and nodes
+- name: Set openshift_version for rpm installation
+ include_tasks: check_available_rpms.yml
+
+- set_fact:
+ openshift_version: "{{ rpm_results.results.versions.available_versions.0 }}"
+ when: openshift_version is not defined