Changes needed to run the packer against CentOS 8 systems
Issue: RELENG-2823
Change-Id: I7748d98150630bc5327d407eab5421a2ec21e7bf
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
- git2u*
- yum-plugin-replace
become: true
+ when:
+ - ansible_distribution_major_version < 8
+
+- name: Enable PowerTools
+ command:
+ cmd: dnf config-manager --set-enabled PowerTools
+ warn: no
+ become: true
+ when: ansible_distribution_major_version >= 8
- name: Install base packages
yum:
- "@base"
- "@development"
- yum-utils
- - https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+ - https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
state: latest
become: true
command: yum replace -y git --replace-with git2u
when: ansible_facts.packages['git'] is defined
become: true
+ when:
+ - ansible_distribution_major_version < 8
return 1
}
+function is_centos8()
+{
+ # if the file exists and contains a centos:8 CPE_NAME, return 0
+ if grep -Eq "^CPE_NAME=.*centos:8" /etc/os-release 2> /dev/null; then
+ echo "Distro is CentOS 8"
+ return 0
+ fi
+ echo "Distro is NOT CentOS 8"
+ return 1
+}
+
if is_ubuntu; then
# Use netselect to choose a package mirror to install python-minimal in a
# reliable manner.
apt install -y python-minimal
fi
-type python
+if is_centos8; then
+ echo "Install python36"
+ dnf clean all
+ dnf install -y python36
+fi
+
+type python || type python3
type sudo