mirror of
https://github.com/openshift/openshift-ansible.git
synced 2026-02-05 06:46:04 +01:00
Require RHEL v8.4 or newer beginning with OpenShift v4.10
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Pre-scaleup checks
|
||||
- name: Pre-scaleup hostfile checks
|
||||
hosts: localhost
|
||||
connection: local
|
||||
gather_facts: no
|
||||
@@ -8,6 +8,13 @@
|
||||
name: openshift_node
|
||||
tasks_from: scaleup_checks.yml
|
||||
|
||||
- name: Pre-scaleup checks
|
||||
hosts: new_workers
|
||||
tasks:
|
||||
- import_role:
|
||||
name: openshift_node
|
||||
tasks_from: version_checks.yml
|
||||
|
||||
- name: install nodes
|
||||
hosts: new_workers
|
||||
roles:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Pre-upgrade checks
|
||||
- name: Pre-upgrade hostfile checks
|
||||
hosts: localhost
|
||||
connection: local
|
||||
gather_facts: no
|
||||
@@ -11,6 +11,13 @@
|
||||
workers host group to upgrade nodes
|
||||
when: groups.workers | default([]) | length == 0
|
||||
|
||||
- name: Pre-upgrade checks
|
||||
hosts: workers
|
||||
tasks:
|
||||
- import_role:
|
||||
name: openshift_node
|
||||
tasks_from: version_checks.yml
|
||||
|
||||
- name: upgrade nodes
|
||||
hosts: workers
|
||||
serial: 1
|
||||
|
||||
25
roles/openshift_node/tasks/version_checks.yml
Normal file
25
roles/openshift_node/tasks/version_checks.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
# This task file is run with import_role for localhost from scaleup.yml and upgrade.yml
|
||||
|
||||
- name: Get cluster version
|
||||
command: >
|
||||
oc get clusterversion
|
||||
--kubeconfig={{ openshift_node_kubeconfig_path }}
|
||||
--output=jsonpath='{.items[0].status.desired.version}'
|
||||
delegate_to: localhost
|
||||
register: oc_get
|
||||
until:
|
||||
- oc_get.stdout != ''
|
||||
changed_when: false
|
||||
|
||||
- name: Set fact l_cluster_version
|
||||
set_fact:
|
||||
l_cluster_version: "{{ oc_get.stdout | regex_search('^\\d+\\.\\d+') }}"
|
||||
|
||||
- name: Fail if not using RHEL8 beginning with version 4.10
|
||||
fail:
|
||||
msg: "As of v4.10, RHEL nodes must be at least version 8.4"
|
||||
when:
|
||||
- l_cluster_version is version('4.10', '>=')
|
||||
- ansible_facts['distribution'] == "RedHat"
|
||||
- ansible_facts['distribution_version'] is version('8.4', '<')
|
||||
Reference in New Issue
Block a user