Skip to content

Commit b1730b0

Browse files
committed
update cluster deploy for ol9
1 parent db18dd2 commit b1730b0

File tree

1 file changed

+103
-8
lines changed

1 file changed

+103
-8
lines changed

olam/deploy_olam_cluster.yml

Lines changed: 103 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
delay: 10
2121
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
2222

23+
- name: Install Oracle EPEL repository
24+
ansible.builtin.dnf:
25+
name: oracle-epel-release-el9
26+
state: present
27+
retries: 5
28+
delay: 10
29+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
30+
2331
- name: Install version lock plugin
2432
ansible.builtin.dnf:
2533
name: python3-dnf-plugin-versionlock
@@ -29,10 +37,20 @@
2937
delay: 10
3038
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
3139

40+
- name: Install version lock plugin
41+
ansible.builtin.dnf:
42+
name: python3-dnf-plugin-versionlock
43+
enablerepo: ol9_developer_EPEL
44+
state: present
45+
retries: 5
46+
delay: 10
47+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
48+
3249
- name: Version lock python3-click
3350
community.general.yum_versionlock:
3451
state: present
3552
name: python3-click
53+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
3654

3755
- name: Install additional packages for ansible
3856
ansible.builtin.dnf:
@@ -46,6 +64,18 @@
4664
delay: 10
4765
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
4866

67+
- name: Install additional packages for ansible
68+
ansible.builtin.dnf:
69+
name:
70+
- python3-psycopg2
71+
- python3-pyOpenSSL
72+
- python3-pip
73+
enablerepo: ol9_developer_EPEL
74+
state: present
75+
retries: 5
76+
delay: 10
77+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
78+
4979
- name: Install pexpect
5080
ansible.builtin.pip:
5181
name: pexpect
@@ -64,17 +94,16 @@
6494

6595
tasks:
6696

67-
- name: Enable the PostgreSQL 13 module stream
97+
- name: Enable the PostgreSQL 16 module stream
6898
ansible.builtin.copy:
6999
dest: /etc/dnf/modules.d/postgresql.module
70100
content: |
71101
[postgresql]
72102
name=postgresql
73-
stream=13
103+
stream=16
74104
profiles=
75105
state=enabled
76106
mode: '0644'
77-
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
78107

79108
- name: Install the database
80109
ansible.builtin.dnf:
@@ -158,7 +187,7 @@
158187
name: postgresql
159188
state: restarted
160189

161-
- name: Configure OLAM 2.2 hosts
190+
- name: Configure OLAM 2.3 hosts
162191
hosts: control,execution
163192
vars_files:
164193
- default_vars.yml
@@ -168,7 +197,7 @@
168197

169198
- name: Install Oracle Linux Automation Manager repository
170199
ansible.builtin.dnf:
171-
name: oraclelinux-automation-manager-release-el8-2.2
200+
name: oraclelinux-automation-manager-release-el8
172201
state: present
173202
retries: 5
174203
delay: 10
@@ -193,22 +222,47 @@
193222
mode: '0644'
194223
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
195224

196-
- name: Enable Oracle Linux Automation Manager 2.2 repository
225+
- name: Disable Oracle Linux Automation Manager 2.2 repository
197226
community.general.ini_file:
198227
path: "/etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo"
199228
section: ol8_automation2.2
200229
option: enabled
230+
value: "0"
231+
mode: '0644'
232+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
233+
234+
- name: Enable Oracle Linux Automation Manager 2.3 repository
235+
community.general.ini_file:
236+
path: "/etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo"
237+
section: ol8_automation2.3
238+
option: enabled
201239
value: "1"
202240
mode: '0644'
203241
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
204242

243+
- name: Install Oracle Linux Automation Manager repository
244+
ansible.builtin.dnf:
245+
name: oraclelinux-automation-manager-release-el9
246+
state: present
247+
retries: 5
248+
delay: 10
249+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
250+
251+
- name: Enable Oracle Linux Automation Manager 2.3 repository
252+
community.general.ini_file:
253+
path: "/etc/yum.repos.d/oraclelinux-automation-manager-ol9.repo"
254+
section: ol9_automation2.3
255+
option: enabled
256+
value: "1"
257+
mode: '0644'
258+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
259+
205260
- name: Install Oracle Linux Automation Manager
206261
ansible.builtin.dnf:
207262
name: ol-automation-manager
208263
state: present
209264
retries: 5
210265
delay: 10
211-
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
212266
environment: "{{ proxy_env }}"
213267

214268
- name: Edit unixsocket in /etc/redis.conf
@@ -217,13 +271,31 @@
217271
regexp: '^unixsocket '
218272
insertafter: '^# unixsocketperm '
219273
line: unixsocket /var/run/redis/redis.sock
274+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
220275

221276
- name: Edit unixsocketperm in /etc/redis.conf
222277
ansible.builtin.lineinfile:
223278
path: /etc/redis.conf
224279
regexp: '^unixsocketperm '
225280
insertafter: '^unixsocket '
226281
line: unixsocketperm 775
282+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
283+
284+
- name: Edit unixsocket in /etc/redis/redis.conf
285+
ansible.builtin.lineinfile:
286+
path: /etc/redis/redis.conf
287+
regexp: '^unixsocket '
288+
insertafter: '^# unixsocketperm '
289+
line: unixsocket /var/run/redis/redis.sock
290+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
291+
292+
- name: Edit unixsocketperm in /etc/redis/redis.conf
293+
ansible.builtin.lineinfile:
294+
path: /etc/redis/redis.conf
295+
regexp: '^unixsocketperm '
296+
insertafter: '^unixsocket '
297+
line: unixsocketperm 775
298+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
227299

228300
- name: Configure CLUSTER_HOST_ID setting
229301
ansible.builtin.copy:
@@ -239,11 +311,23 @@
239311
- name: Provision olam ansible container environment # noqa: syntax-check[unknown-module]
240312
containers.podman.podman_image:
241313
name: container-registry.oracle.com/oracle_linux_automation_manager/olam-ee
242-
tag: 2.2
314+
tag: 2.3-ol8
315+
become: true
316+
become_user: awx
317+
retries: 5
318+
delay: 10
319+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8'
320+
environment: "{{ proxy_env }}"
321+
322+
- name: Provision olam ansible container environment # noqa: syntax-check[unknown-module]
323+
containers.podman.podman_image:
324+
name: container-registry.oracle.com/oracle_linux_automation_manager/olam-ee
325+
tag: 2.3-ol9
243326
become: true
244327
become_user: awx
245328
retries: 5
246329
delay: 10
330+
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
247331
environment: "{{ proxy_env }}"
248332

249333
- name: Generate an OpenSSL private key with a different size (2048 bits)
@@ -529,3 +613,14 @@
529613
enabled: true
530614
with_items:
531615
- ol-automation-manager
616+
617+
- name: Check if user is lingering
618+
ansible.builtin.stat:
619+
path: "/var/lib/systemd/linger/awx"
620+
register: user_lingering
621+
622+
- name: Enable lingering is needed
623+
ansible.builtin.command: "loginctl enable-linger awx"
624+
register: linger_result
625+
changed_when: linger_result.rc == 0
626+
when: not user_lingering.stat.exists

0 commit comments

Comments
 (0)