File tree 3 files changed +41
-2
lines changed
roles/openshift_node/tasks 3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- - name : Pre-scaleup checks
2
+ - name : Pre-scaleup hostfile checks
3
3
hosts : localhost
4
4
connection : local
5
5
gather_facts : no
8
8
name : openshift_node
9
9
tasks_from : scaleup_checks.yml
10
10
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
+
11
18
- name : install nodes
12
19
hosts : new_workers
13
20
roles :
Original file line number Diff line number Diff line change 1
1
---
2
- - name : Pre-upgrade checks
2
+ - name : Pre-upgrade hostfile checks
3
3
hosts : localhost
4
4
connection : local
5
5
gather_facts : no
11
11
workers host group to upgrade nodes
12
12
when : groups.workers | default([]) | length == 0
13
13
14
+ - name : Pre-upgrade checks
15
+ hosts : workers
16
+ tasks :
17
+ - import_role :
18
+ name : openshift_node
19
+ tasks_from : version_checks.yml
20
+
14
21
- name : upgrade nodes
15
22
hosts : workers
16
23
serial : 1
Original file line number Diff line number Diff line change
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', '<')
You can’t perform that action at this time.
0 commit comments