Merged in al2022 (pull request #187)

Add support for Amazon Linux 2022

* first pass at basic AL2022 support

* unpin git version on AL2022

* resolve a few package issues/discrepancies

* fix non-Amazon distro support

* fix missing nfs.service symlink on AL2022

* remove Ubuntu/Debian install task from aws_common (no existing ubuntu dependency tasks)

* add amazonlinux:2022 to list of images for testing via molecule

* install amazon-cloudwatch-agent from package sources instead of direct RPM on AL2022; add workaround for missing group

* fix typo in task name

* add mising amazonlinux:2022 test for product_install role

* al2022 -> al2023

* al2023 ships with rpm-installed versions of setuptools and distlib that aren't removable and older than what pipenv requires; use py3.11 instead


Approved-by: Vadym Kovalskiy
Approved-by: Eugene Ivantsov
Approved-by: Yurii Kuzan
This commit is contained in:
Lee Goolsbee
2023-05-17 17:11:12 +00:00
parent 1124f1ac5a
commit 6151f01534
54 changed files with 321 additions and 16 deletions

View File

@@ -2,8 +2,10 @@
set -e
PIP_BIN="pip3"
source /etc/os-release
if [[ $ID = "amzn" ]]; then
if [[ $ID = "amzn" ]] && [[ $VERSION = "2" ]]; then
amazon-linux-extras enable python3.8
yum clean metadata
yum install -y \
@@ -11,6 +13,12 @@ if [[ $ID = "amzn" ]]; then
python38 \
python38-pip \
python38-devel
elif [[ $ID = "amzn" ]] && [[ $VERSION = "2023" ]]; then
dnf install -y \
python3.11 \
python3.11-pip \
python3.11-devel
PIP_BIN="pip3.11"
else
# FIXME: Currently assumes Debian-based
apt-get update && \
@@ -22,7 +30,7 @@ export PATH=/usr/local/bin:$PATH
export PIP_DEFAULT_TIMEOUT=60
echo "Installing pipenv..."
pip3 install pipenv
$PIP_BIN install pipenv
echo "Installing ansible and dependencies..."
PIPENV_NOSPIN=1 PIPENV_HIDE_EMOJIS=1 pipenv sync 2>&1 | iconv -c -f utf-8 -t ascii