Skip to content

Commit fc23779

Browse files
committed
Require RHEL v8.4 or newer beginning with OpenShift v4.10
1 parent 08de330 commit fc23779

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

playbooks/scaleup.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: Pre-scaleup checks
2+
- name: Pre-scaleup hostfile checks
33
hosts: localhost
44
connection: local
55
gather_facts: no
@@ -8,6 +8,13 @@
88
name: openshift_node
99
tasks_from: scaleup_checks.yml
1010

11+
- name: Pre-scaleup checks
12+
hosts: new_workers
13+
tasks:
14+
- import_role:
15+
name: openshift_node
16+
tasks_from: version_checks.yml
17+
1118
- name: install nodes
1219
hosts: new_workers
1320
roles:

playbooks/upgrade.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: Pre-upgrade checks
2+
- name: Pre-upgrade hostfile checks
33
hosts: localhost
44
connection: local
55
gather_facts: no
@@ -11,6 +11,13 @@
1111
workers host group to upgrade nodes
1212
when: groups.workers | default([]) | length == 0
1313

14+
- name: Pre-upgrade checks
15+
hosts: workers
16+
tasks:
17+
- import_role:
18+
name: openshift_node
19+
tasks_from: version_checks.yml
20+
1421
- name: upgrade nodes
1522
hosts: workers
1623
serial: 1
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# This task file is run with import_role for localhost from scaleup.yml and upgrade.yml
3+
4+
- name: Get cluster version
5+
command: >
6+
oc get clusterversion
7+
--kubeconfig={{ openshift_node_kubeconfig_path }}
8+
--output=jsonpath='{.items[0].status.desired.version}'
9+
delegate_to: localhost
10+
register: oc_get
11+
until:
12+
- oc_get.stdout != ''
13+
changed_when: false
14+
15+
- name: Set fact l_cluster_version
16+
set_fact:
17+
l_cluster_version: "{{ oc_get.stdout | regex_search('^\\d+\\.\\d+') }}"
18+
19+
- name: Fail if not using RHEL8 beginning with version 4.10
20+
fail:
21+
msg: "As of v4.10, RHEL nodes must be at least version 8.4"
22+
when:
23+
- l_cluster_version is version('4.10', '>=')
24+
- ansible_facts['distribution'] == "RedHat"
25+
- ansible_facts['distribution_version'] is version('8.4', '<')

0 commit comments

Comments
 (0)