Skip to content

Commit 3a3d57b

Browse files
committed
experimental support for OracleLinux 9
1 parent 571c627 commit 3a3d57b

File tree

12 files changed

+214
-4
lines changed

12 files changed

+214
-4
lines changed

changelogs/fragments/ol9.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
minor_changes:
3+
- "experimental support for OracleLinux 9 ()"

docker/molecule/Dockerfile-ol9

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM oraclelinux:9
2+
LABEL maintainer="Thorsten Bruhns"
3+
# Original code is copied from:
4+
# https://raw.githubusercontent.com/geerlingguy/docker-ubi8-ansible/master/Dockerfile
5+
#
6+
ENV container=docker
7+
8+
ENV pip_packages "ansible"
9+
10+
# Silence annoying subscription messages.
11+
RUN echo "enabled=0" >> /etc/yum/pluginconf.d/subscription-manager.conf
12+
13+
# Install systemd -- See https://hub.docker.com/_/centos/
14+
RUN yum -y update; yum clean all; \
15+
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
16+
rm -f /lib/systemd/system/multi-user.target.wants/*;\
17+
rm -f /etc/systemd/system/*.wants/*;\
18+
rm -f /lib/systemd/system/local-fs.target.wants/*; \
19+
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
20+
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
21+
rm -f /lib/systemd/system/basic.target.wants/*;\
22+
rm -f /lib/systemd/system/anaconda.target.wants/*;
23+
24+
# Install requirements.
25+
RUN yum makecache --timer \
26+
&& yum -y install initscripts \
27+
&& yum -y update \
28+
&& yum -y install \
29+
sudo \
30+
which \
31+
hostname \
32+
python3 \
33+
python3-pip \
34+
&& yum clean all
35+
36+
# Install Ansible via Pip.
37+
RUN pip3 install --upgrade pip \
38+
&& pip3 install $pip_packages
39+
40+
# Disable requiretty.
41+
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
42+
43+
# Install Ansible inventory file.
44+
RUN mkdir -p /etc/ansible
45+
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
46+
47+
VOLUME ["/sys/fs/cgroup"]
48+
CMD ["/usr/lib/systemd/systemd"]

extensions/molecule/dbfs/converge.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
---
2+
- name: Converge
3+
hosts: all
4+
gather_facts: true
5+
any_errors_fatal: true
6+
tasks:
7+
# install missing cron on rhel9 container
8+
- name: Install cron on RHEL/OL9
9+
ansible.builtin.package:
10+
name: cronie
11+
when: ansible_distribution_major_version | int == 9
12+
213
- name: Converge os
314
ansible.builtin.import_playbook: opitzconsulting.ansible_oracle.os
415

extensions/molecule/default/converge.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
gather_facts: true
55
any_errors_fatal: true
66
tasks:
7+
# install missing cron on rhel9 container
8+
- name: Install cron on RHEL/OL9
9+
ansible.builtin.package:
10+
name: cronie
11+
when: ansible_distribution_major_version | int == 9
12+
713
- name: "Import common"
814
ansible.builtin.import_role:
915
name: opitzconsulting.ansible_oracle.common

extensions/molecule/default/molecule.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ platforms:
2424
- /sys/fs/cgroup:/sys/fs/cgroup:rw
2525
cgroupns_mode: host
2626
privileged: true
27+
- name: ol9
28+
image: "quay.io/rendanic/docker-ol9-ansible:latest"
29+
pre_build_image: true
30+
# The following 4 lines are needed only for making systemd work
31+
command: ${MOLECULE_DOCKER_COMMAND:-""}
32+
volumes:
33+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
34+
cgroupns_mode: host
35+
privileged: true
2736
# - name: SLES-15-3
2837
# image: "registry.suse.com/bci/bci-base-ansible:15.3"
2938
# pre_build_image: true

roles/common/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ sets up the host generic stuff
1010
- [common_packages_el6](#common_packages_el6)
1111
- [common_packages_el7](#common_packages_el7)
1212
- [common_packages_el8](#common_packages_el8)
13+
- [common_packages_el9](#common_packages_el9)
1314
- [common_packages_sles](#common_packages_sles)
1415
- [configure_epel_repo](#configure_epel_repo)
1516
- [configure_motd](#configure_motd)
@@ -18,6 +19,7 @@ sets up the host generic stuff
1819
- [epel6_rpm](#epel6_rpm)
1920
- [epel7_rpm](#epel7_rpm)
2021
- [epel8_rpm](#epel8_rpm)
22+
- [epel9_rpm](#epel9_rpm)
2123
- [install_os_packages](#install_os_packages)
2224
- [motd_template](#motd_template)
2325
- [ntp_type](#ntp_type)
@@ -202,6 +204,59 @@ common_packages_el8:
202204
- python3-pip
203205
```
204206
207+
### common_packages_el9
208+
209+
#### Default value
210+
211+
```YAML
212+
common_packages_el9:
213+
- screen
214+
- facter
215+
- lsof
216+
- nc
217+
- rlwrap
218+
- expect
219+
- git
220+
- lvm2
221+
- xfsprogs
222+
- autofs
223+
- parted
224+
- mlocate
225+
- lvm2
226+
- python3
227+
- python3-pip
228+
- bind-utils
229+
- binutils
230+
- ethtool
231+
- glibc
232+
- glibc-devel
233+
- initscripts
234+
- ksh
235+
- libaio
236+
- libaio-devel
237+
- libgcc
238+
- libnsl
239+
- libstdc++
240+
- libstdc++-devel
241+
- make
242+
- module-init-tools
243+
- net-tools
244+
- nfs-utils
245+
- openssh-clients
246+
- pam
247+
- policycoreutils
248+
- policycoreutils-python-utils
249+
- procps
250+
- psmisc
251+
- smartmontools
252+
- sysstat
253+
- tar
254+
- unzip
255+
- util-linux-ng
256+
- xorg-x11-utils
257+
- xorg-x11-xauth
258+
```
259+
205260
### common_packages_sles
206261
207262
List of RPMs for SuSE Linux Enterprise Server
@@ -292,6 +347,16 @@ Url for epel-release-latest-8.noarch.rpm
292347
epel8_rpm: https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
293348
```
294349

350+
### epel9_rpm
351+
352+
Url for epel-release-latest-8.noarch.rpm
353+
354+
#### Default value
355+
356+
```YAML
357+
epel9_rpm: oracle-epel-release-el9
358+
```
359+
295360
### install_os_packages
296361

297362
#### Default value

roles/common/defaults/main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Lab playbook - sets up the host specific shit
22
---
3+
# @var epel9_rpm:description: Url for epel-release-latest-8.noarch.rpm
4+
# epel9_rpm: https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
5+
epel9_rpm: oracle-epel-release-el9
6+
37
# @var epel8_rpm:description: Url for epel-release-latest-8.noarch.rpm
48
epel8_rpm: https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
59

@@ -45,6 +49,7 @@ ntp_type: "{% if ansible_distribution_major_version | int >= 8 %}chrony\
4549
common_packages: "{% if ansible_distribution_major_version | int == 6 %}{{ common_packages_el6 }}\
4650
{%- elif ansible_distribution_major_version | int == 7 %}{{ common_packages_el7 }}\
4751
{%- elif ansible_distribution_major_version | int == 8 %}{{ common_packages_el8 }}\
52+
{%- elif ansible_distribution_major_version | int == 9 %}{{ common_packages_el9 }}\
4853
{%- else %}None\
4954
{%- endif %}"
5055

@@ -185,6 +190,55 @@ common_packages_el8:
185190
- python3
186191
- python3-pip
187192

193+
# @var common_packages_el8:description: >
194+
# List of RPMs for RHEL8 or OL8
195+
common_packages_el9:
196+
- screen
197+
- facter
198+
- lsof
199+
- nc
200+
- rlwrap
201+
- expect
202+
- git
203+
- lvm2
204+
- xfsprogs
205+
- autofs
206+
- parted
207+
- mlocate
208+
- lvm2
209+
- python3
210+
- python3-pip
211+
- bind-utils
212+
- binutils
213+
- ethtool
214+
- glibc
215+
- glibc-devel
216+
- initscripts
217+
- ksh
218+
- libaio
219+
- libaio-devel
220+
- libgcc
221+
- libnsl
222+
- libstdc++
223+
- libstdc++-devel
224+
- make
225+
- module-init-tools
226+
- net-tools
227+
- nfs-utils
228+
- openssh-clients
229+
- pam
230+
- policycoreutils
231+
- policycoreutils-python-utils
232+
- procps
233+
- psmisc
234+
- smartmontools
235+
- sysstat
236+
- tar
237+
- unzip
238+
- util-linux-ng
239+
- xorg-x11-utils
240+
- xorg-x11-xauth
241+
188242
# @var common_packages_sles:description: >
189243
# List of RPMs for SuSE Linux Enterprise Server
190244
common_packages_sles:

roles/common/tasks/assert.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- (
1212
ansible_os_family == 'RedHat'
1313
and ansible_distribution_major_version is version('6', '>=')
14-
and ansible_distribution_major_version is version('8', '<=')
14+
and ansible_distribution_major_version is version('9', '<=')
1515
)
1616
or
1717
(ansible_os_family == 'Suse')

roles/common/vars/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
_common_epel_rpm: >-
44
{%- if ansible_distribution_major_version | int == 6 %}{{ epel6_rpm }}
55
{% elif ansible_distribution_major_version | int == 7 %}{{ epel7_rpm }}
6-
{% elif ansible_distribution_major_version | int == 8 %}{{ epel8_rpm }}{%- else %}None{%- endif %}
6+
{% elif ansible_distribution_major_version | int == 8 %}{{ epel8_rpm }}
7+
{% elif ansible_distribution_major_version | int == 9 %}{{ epel9_rpm }}{%- else %}None{%- endif %}
78
89
# helper variable for internal use
910
_common_ol_repo_file: >-

roles/orahost/tasks/RedHat.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# OL8/RHEL8 has all needed RPMs in orahost role!
3-
- name: Install packages required by Oracle on OL/RHEL version 6 and 7
3+
- name: Install packages required by Oracle on OL/RHEL version 6,7,8,9
44
ansible.builtin.yum:
55
name: "{{ oracle_packages }}"
66
state: installed

0 commit comments

Comments
 (0)