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

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
# - name: ubuntu_lts
# image: ubuntu:bionic
provisioner:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
# - name: ubuntu_lts
# image: ubuntu:bionic
provisioner:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
# - name: ubuntu_lts
# image: ubuntu:bionic
provisioner:

View File

@@ -0,0 +1,25 @@
---
- name: Install AWS support packages
ansible.builtin.dnf:
name:
- amazon-efs-utils
- amazon-ssm-agent
- awscli
- git
- ec2-utils
# https://github.com/amazonlinux/amazon-linux-2023/issues/164
- name: Ensure group "aoc" exists
ansible.builtin.group:
name: aoc
state: present
when: atl_aws_enable_cloudwatch is defined and atl_aws_enable_cloudwatch | bool
- name: Install CloudWatch Agent
ansible.builtin.dnf:
name:
- amazon-cloudwatch-agent
when: atl_aws_enable_cloudwatch is defined and atl_aws_enable_cloudwatch | bool
notify:
- Enable CloudWatch Agent

View File

@@ -5,8 +5,9 @@
tags:
- notest
- name: Install distro-specific prerequisites
ansible.builtin.include_tasks: "{{ ansible_distribution|lower }}.yml"
- name: Install Amazon-Linux-specific prerequisites
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}.yml"
when: ansible_distribution | lower == 'amazon'
- name: Use EC2 instance ID for cluster node ID
ansible.builtin.set_fact:

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -7,6 +7,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -0,0 +1,15 @@
---
- name: Install Google Noto fonts for language coverage
ansible.builtin.dnf:
name:
- "google-noto-*"
- name: Link the language fonts into the JDK
# Not idiomatic, but cleaner than messing with nested lookups...
ansible.builtin.shell:
cmd: "ln -sf /usr/share/fonts/google-noto*/* {{ item }}/"
creates: "{{ item }}/NotoSansJavanese-Regular.ttf"
warn: false
with_items: "{{ atl_fonts_fallback_dirs }}"
changed_when: false # For Molecule idempotence check

View File

@@ -129,5 +129,10 @@
mode: 0755
with_items: "{{ atl_fonts_fallback_dirs }}"
- name: Install & configure distro language fonts
ansible.builtin.include_tasks: "{{ ansible_distribution|lower }}_fonts.yml"
- name: Install & configure Amazon-Linux-specific language fonts
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}_fonts.yml"
when: ansible_distribution | lower == 'amazon'
- name: Install & configure Ubuntu/Debian-specific language fonts
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}_fonts.yml"
when: ansible_distribution | lower != 'amazon'

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -1,6 +1,6 @@
---
- name: Install Amazon-Linux-specific support packages
- name: Install Amazon-Linux-2-specific support packages
ansible.builtin.yum:
name:
- dejavu-sans-fonts

View File

@@ -0,0 +1,16 @@
---
- name: Install Amazon-Linux-2023-specific support packages
ansible.builtin.dnf:
name:
- dejavu-sans-fonts
- file
- git
- libxml2
- shadow-utils
- name: Uninstall curl-minimal (conflicts with curl)
ansible.builtin.dnf:
name: curl-minimal
state: absent
autoremove: no

View File

@@ -2,8 +2,13 @@
# Note: Try and limit these to packages that are distro-specific, and
# place commonly-named ones below.
- name: Install distro-specific prerequisites
ansible.builtin.include_tasks: "{{ ansible_distribution|lower }}.yml"
- name: Install Amazon-Linux-specific prerequisites
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}.yml"
when: ansible_distribution | lower == 'amazon'
- name: Install Ubuntu/Debian-specific prerequisites
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}.yml"
when: ansible_distribution | lower != 'amazon'
- name: Install common support packages
ansible.builtin.package:

View File

@@ -1,6 +1,6 @@
---
- name: Install Amazon-Linux-specific NFS packages
- name: Install Amazon-Linux-2-specific NFS packages
ansible.builtin.yum:
name:
- nfs-utils

View File

@@ -0,0 +1,14 @@
---
- name: Install Amazon-Linux-2023-specific NFS packages
ansible.builtin.dnf:
name:
- nfs-utils
- name: Create nfs.service symlink to nfs-server.service
ansible.builtin.file:
src: /usr/lib/systemd/system/nfs-server.service
dest: /usr/lib/systemd/system/nfs.service
owner: root
group: root
state: link

View File

@@ -1,8 +1,12 @@
---
- name: Install distro-specific NFS packages
ansible.builtin.include_tasks: "{{ ansible_distribution|lower }}.yml"
- name: Install Amazon-Linux-specific NFS packages
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}.yml"
when: ansible_distribution | lower == 'amazon'
- name: Install Ubuntu/Debian-specific NFS packages
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}.yml"
when: ansible_distribution | lower != 'amazon'
- name: Create mountpoint
ansible.builtin.file:

View File

@@ -4,6 +4,8 @@ driver:
platforms:
- name: amazon_linux2
image: amazonlinux:2
- name: amazon_linux2023
image: amazonlinux:2023
- name: ubuntu_lts
image: ubuntu:bionic
provisioner:

View File

@@ -4,6 +4,8 @@ driver:
platforms:
- name: amazon_linux2
image: amazonlinux:2
- name: amazon_linux2023
image: amazonlinux:2023
- name: ubuntu_lts
image: ubuntu:bionic
provisioner:

View File

@@ -1,6 +1,6 @@
---
- name: Add Adoptium repo and install Eclipse Temurin JDK if necessary on Amazon Linux
- name: Add Adoptium repo and install Eclipse Temurin JDK if necessary on Amazon Linux 2
block:
- name: Add Adoptium yum repository
@@ -31,7 +31,7 @@
tags:
- runtime_pkg
- name: Install other base packages on Amazon Linux
- name: Install other base packages on Amazon Linux 2
ansible.builtin.yum:
name:
- dejavu-fonts-common # Required by the installer

View File

@@ -0,0 +1,37 @@
---
- name: Add Adoptium repo and install Eclipse Temurin JDK if necessary on Amazon Linux 2023
block:
# There is no amazonlinux/2023 package available from the Adoptium repo; AL2023 docs point to upstream compatiblity
# with Fedora 34, 35, and 36, so we use the latest of those for the Temurin package for now
- name: Add Adoptium yum repository
ansible.builtin.yum_repository:
name: Adoptium
file: adoptium
description: Adoptium Repo
baseurl: "https://packages.adoptium.net/artifactory/rpm/fedora/36/{{ ansible_architecture }}"
gpgkey: https://packages.adoptium.net/artifactory/api/gpg/key/public
gpgcheck: yes
state: present
- name: Install Eclipse Temurin JDK
ansible.builtin.yum:
name: "temurin-{{ java_major_version }}-jdk"
state: present
- name: Ensure common JDK symlink exists
community.general.alternatives:
link: "/usr/lib/jvm/java"
name: "java_sdk"
path: "/usr/lib/jvm/temurin-{{ java_major_version }}-jdk"
priority: 99
when: atl_use_system_jdk | bool
tags:
- runtime_pkg
- name: Install other base packages on Amazon Linux 2023
ansible.builtin.dnf:
name:
- dejavu-fonts-all # Required by the installer

View File

@@ -1,4 +1,9 @@
---
- name: Perform distro-specific tasks
ansible.builtin.include_tasks: "{{ ansible_distribution|lower }}.yml"
- name: Perform Amazon-Linux-specific tasks
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}.yml"
when: ansible_distribution | lower == 'amazon'
- name: Perform Ubuntu/Debian-specific tasks
ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}.yml"
when: ansible_distribution | lower != 'amazon'

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -6,6 +6,10 @@ platforms:
image: amazonlinux:2
groups:
- aws_node_local
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups:

View File

@@ -8,6 +8,12 @@ platforms:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: amazon_linux2023
image: amazonlinux:2023
groups:
- aws_node_local
ulimits:
- nofile:262144:262144
- name: ubuntu_lts
image: ubuntu:bionic
groups: