Skip to content

Commit

Permalink
Oracle Linux 8 support and fixes (kubernetes-sigs#6198)
Browse files Browse the repository at this point in the history
* Add oraclelinux8 and disable firewalld

Add oraclelinux8 image and disable firewalld on oraclelinux VMs

* Fix Oracle Linux repositories

As documented in: http://yum.oracle.com/getting-started.html#installing-software-from-oracle-linux-yum-server
public-yum-ol7.repo was deprecated on release 7.6. Some repos were integrated into oracle-linux-ol7.repo (i.e.: ol7_latest, ol7_addons) and other are available as packages (epel). This also adds support for oraclelinux8

* Fix to use ansible_distribution_version

Instead of ansible_distribution_major_version

* Update README.md
  • Loading branch information
marcosfsch authored and LuckySB committed Jun 29, 2020
1 parent 1a35286 commit e1f18b1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ vagrant up
- **Container Linux by CoreOS**
- **Debian** Buster, Jessie, Stretch, Wheezy
- **Ubuntu** 16.04, 18.04
- **CentOS/RHEL** 7, 8 (experimental: see [centos 8 notes](docs/centos8.md)
- **CentOS/RHEL** 7, 8 (experimental: see [centos 8 notes](docs/centos8.md))
- **Fedora** 30, 31
- **Fedora CoreOS** (experimental: see [fcos Note](docs/fcos.md))
- **openSUSE** Leap 42.3/Tumbleweed
- **Oracle Linux** 7
- **Oracle Linux** 7, 8 (experimental: [centos 8 notes](docs/centos8.md) apply)

Note: Upstart/SysV init based OS types are not supported.

Expand Down
6 changes: 6 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ SUPPORTED_OS = {
"opensuse" => {box: "bento/opensuse-leap-15.1", user: "vagrant"},
"opensuse-tumbleweed" => {box: "opensuse/Tumbleweed.x86_64", user: "vagrant"},
"oraclelinux" => {box: "generic/oracle7", user: "vagrant"},
"oraclelinux8" => {box: "generic/oracle8", user: "vagrant"},
}

if File.exist?(CONFIG)
Expand Down Expand Up @@ -185,6 +186,11 @@ Vagrant.configure("2") do |config|
# Disable swap for each vm
node.vm.provision "shell", inline: "swapoff -a"

# Disable firewalld on oraclelinux vms
if ["oraclelinux","oraclelinux8"].include? $os
node.vm.provision "shell", inline: "systemctl stop firewalld; systemctl disable firewalld"
end

host_vars[vm_name] = {
"ip": ip,
"flannel_interface": "eth1",
Expand Down
32 changes: 27 additions & 5 deletions roles/bootstrap-os/tasks/bootstrap-centos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---
- name: Gather host facts to get ansible_distribution_version ansible_distribution_major_version
setup:
gather_subset: '!all'
filter: ansible_distribution_*version

# For Oracle Linux install public repo
- name: Download Oracle Linux public yum repo
get_url:
Expand All @@ -7,6 +12,7 @@
when:
- use_oracle_public_repo|default(true)
- '"Oracle" in os_release.stdout'
- (ansible_distribution_version | float) < 7.6

- name: Enable Oracle Linux repo
ini_file:
Expand All @@ -21,6 +27,27 @@
when:
- use_oracle_public_repo|default(true)
- '"Oracle" in os_release.stdout'
- (ansible_distribution_version | float) < 7.6

- name: Enable Oracle Linux repo
ini_file:
dest: "/etc/yum.repos.d/oracle-linux-ol{{ ansible_distribution_major_version }}.repo"
section: "{{ item }}"
option: enabled
value: "1"
with_items:
- "ol{{ ansible_distribution_major_version }}_addons"
when:
- '"Oracle" in os_release.stdout'
- (ansible_distribution_version | float) >= 7.6

- name: Install EPEL for Oracle Linux repo package
package:
name: "oracle-epel-release-el{{ ansible_distribution_major_version }}"
state: present
when:
- '"Oracle" in os_release.stdout'
- (ansible_distribution_version | float) >= 7.6

# CentOS ships with python installed

Expand Down Expand Up @@ -51,11 +78,6 @@
no_extra_spaces: true
become: true

- name: Gather host facts to get ansible_distribution_major_version
setup:
gather_subset: '!all'
filter: ansible_distribution_major_version

# libselinux-python is required on SELinux enabled hosts
# See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements
- name: Install libselinux python package
Expand Down

0 comments on commit e1f18b1

Please sign in to comment.