Skip to content

Commit be8c86b

Browse files
authored
Merge pull request #55 from bgraef/main
add dnf retry and async for cluster start to ocne2
2 parents a02fa81 + 1abbab8 commit be8c86b

File tree

4 files changed

+50
-26
lines changed

4 files changed

+50
-26
lines changed

ocne2/deploy_ocne_libvirt.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
- cockpit
2323
- cockpit-machines
2424
state: present
25+
retries: 5
26+
delay: 10
2527
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
2628

2729
- name: Install Oracle Linux 9 virtualization packages
@@ -35,6 +37,8 @@
3537
- cockpit
3638
- cockpit-machines
3739
state: present
40+
retries: 5
41+
delay: 10
3842
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
3943

4044
- name: Start and enable Oracle Linux 8 monolithic virtualization services
@@ -110,6 +114,8 @@
110114
ansible.builtin.dnf:
111115
name: oracle-olcne-release-el8
112116
state: present
117+
retries: 5
118+
delay: 10
113119
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
114120

115121
- name: Enable ocne repository
@@ -123,6 +129,8 @@
123129
ansible.builtin.dnf:
124130
name: oracle-olcne-release-el9
125131
state: present
132+
retries: 5
133+
delay: 10
126134
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
127135

128136
- name: Enable ocne repository
@@ -138,6 +146,8 @@
138146
- ocne
139147
- kubectl
140148
state: present
149+
retries: 5
150+
delay: 10
141151

142152
- name: Create an ocne cluster
143153
when:

ocne2/deploy_ocne_oci.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
- cockpit
2424
- cockpit-machines
2525
state: present
26+
retries: 5
27+
delay: 10
2628
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
2729

2830
- name: Install Oracle Linux 9 virtualization packages
@@ -36,6 +38,8 @@
3638
- cockpit
3739
- cockpit-machines
3840
state: present
41+
retries: 5
42+
delay: 10
3943
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
4044

4145
- name: Start and enable Oracle Linux 8 monolithic virtualization services
@@ -111,6 +115,8 @@
111115
ansible.builtin.dnf:
112116
name: oracle-olcne-release-el8
113117
state: present
118+
retries: 5
119+
delay: 10
114120
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
115121

116122
- name: Enable ocne repository
@@ -124,6 +130,8 @@
124130
ansible.builtin.dnf:
125131
name: oracle-olcne-release-el9
126132
state: present
133+
retries: 5
134+
delay: 10
127135
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
128136

129137
- name: Enable ocne repository
@@ -139,6 +147,8 @@
139147
- ocne
140148
- kubectl
141149
state: present
150+
retries: 5
151+
delay: 10
142152

143153
- name: Create an ocne cluster
144154
when:
@@ -170,6 +180,8 @@
170180
ansible.builtin.dnf:
171181
name: oraclelinux-developer-release-el8
172182
state: present
183+
retries: 5
184+
delay: 10
173185
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
174186

175187
- name: Enable ol developer repository
@@ -184,12 +196,16 @@
184196
name:
185197
- python36-oci-cli
186198
state: present
199+
retries: 5
200+
delay: 10
187201
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
188202

189203
- name: Install ol developer repository
190204
ansible.builtin.dnf:
191205
name: oraclelinux-developer-release-el9
192206
state: present
207+
retries: 5
208+
delay: 10
193209
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
194210

195211
- name: Enable ol developer repository
@@ -204,6 +220,8 @@
204220
name:
205221
- python36-oci-cli
206222
state: present
223+
retries: 5
224+
delay: 10
207225
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
208226

209227
- name: Generate random hex string
@@ -273,14 +291,24 @@
273291
chdir: ~/
274292
become: true
275293
become_user: "{{ username }}"
276-
register: provision_cluster
277-
changed_when: provision_cluster.rc == 0
294+
async: 3600
295+
poll: 10
296+
register: cluster_sleeper
297+
changed_when: cluster_sleeper.rc == 0
278298

279299
- name: Print cluster provision output
280300
ansible.builtin.debug:
281-
var: provision_cluster
301+
var: cluster_sleeper
282302
when: debug_enabled
283303

304+
# - name: Check on cluster provisioning
305+
# ansible.builtin.async_status:
306+
# jid: "{{ cluster_sleeper.ansible_job_id }}"
307+
# register: job_result
308+
# until: job_result.finished
309+
# retries: 360
310+
# delay: 10
311+
284312
- name: Add kubeconfig to .bashrc file
285313
ansible.builtin.lineinfile:
286314
path: ~/.bashrc

ocne2/requirements.yml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,10 @@
77
# roles:
88

99
collections:
10-
- name: https://github.com/ansible-collections/community.general.git
11-
type: git
12-
version: main
13-
14-
- name: https://github.com/ansible-collections/ansible.posix.git
15-
type: git
16-
version: main
17-
18-
- name: https://github.com/oracle/oci-ansible-collection.git
19-
type: git
20-
version: master
21-
22-
- name: https://github.com/ansible-collections/community.postgresql.git
23-
type: git
24-
version: main
25-
26-
- name: https://github.com/ansible-collections/community.crypto.git
27-
type: git
28-
version: main
29-
30-
- name: https://github.com/ansible-collections/community.libvirt.git
31-
type: git
32-
version: main
10+
- ansible.posix
11+
- community.general
12+
- community.postgresql
13+
- community.crypto
14+
- freeipa.ansible_freeipa
15+
- community.libvirt
16+
- oracle.oci

ocne2/update_all_rpms.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
name: "*"
1818
state: latest
1919
update_only: true
20+
retries: 5
21+
delay: 10
2022
when: ansible_distribution == 'OracleLinux'
2123

2224
- name: Check if a reboot is required

0 commit comments

Comments
 (0)