From 4dbb891633d0ef08646f60b5d3a72948c1522659 Mon Sep 17 00:00:00 2001 From: Guillermo Sanchez Gavier Date: Wed, 8 May 2024 09:29:21 +0200 Subject: [PATCH] feat: Add ubuntu 24.04 --- .github/workflows/ci_build_docker_runner.yml | 1 + .github/workflows/testing.yml | 9 ++++++--- .gitignore | 5 ++++- README.md | 1 + action.yml | 6 ++---- molecule/default/dockerfiles/ubuntu2404 | 10 ++++++++++ prepare_platform.sh | 2 +- 7 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 molecule/default/dockerfiles/ubuntu2404 diff --git a/.github/workflows/ci_build_docker_runner.yml b/.github/workflows/ci_build_docker_runner.yml index 78c3946..4fa29d6 100644 --- a/.github/workflows/ci_build_docker_runner.yml +++ b/.github/workflows/ci_build_docker_runner.yml @@ -37,6 +37,7 @@ jobs: - ubuntu1804 - ubuntu2004 - ubuntu2204 + - ubuntu2404 steps: - name: Checkout repository diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index bcc2aa1..bab1ccf 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -5,7 +5,10 @@ on: jobs: molecule-packaging-tests: name: Launch molecule tests with infra-agent package - runs-on: ubuntu-20.04 + strategy: + matrix: + os: [ubuntu-22.04, ubuntu-20.04] + runs-on: ${{ matrix.os }} env: TESTING: 'true' steps: @@ -16,6 +19,6 @@ jobs: with: repo_base_url: 'https://download.newrelic.com/infrastructure_agent' package_name: 'newrelic-infra' - package_version: '1.48.4' + package_version: '1.52.1' gpg_key: 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg' - platforms: "al2,al2023,centos7,centos8,debian-bullseye,debian-buster,redhat8,redhat9,suse15.2,suse15.3,suse15.4,suse15.5,ubuntu1604,ubuntu1804,ubuntu2004,ubuntu2204" + platforms: "al2,al2023,centos7,centos8,debian-bullseye,debian-buster,redhat8,redhat9,suse15.2,suse15.3,suse15.4,suse15.5,ubuntu1604,ubuntu1804,ubuntu2004,ubuntu2204,ubuntu2404" diff --git a/.gitignore b/.gitignore index f548f89..31c4505 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -molecule/default/molecule.yml +# having the molecule.yml in .gitignore prevents the molecule converge to run. +# https://github.com/ansible/molecule/issues/4117 + +#molecule/default/molecule.yml diff --git a/README.md b/README.md index b08de80..10849a0 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Github action that tests the correct installation of a given package and version - ubuntu1804 - ubuntu2004 - ubuntu2204 + - ubuntu2404 ## Example usage diff --git a/action.yml b/action.yml index ff595c3..95cbff7 100644 --- a/action.yml +++ b/action.yml @@ -23,10 +23,8 @@ runs: - name: Configure Molecule and Ansible shell: bash run: | - sudo pipx uninstall ansible-core - sudo pip3 install molecule[docker]==4.0.4 - sudo pip3 install 'rich>=10.0.0,<11.0.0' - sudo pip3 install ansible-lint[community]==5.3.2 + python3 -m pip install molecule ansible-core + python3 -m pip install "molecule-plugins[docker]" - name: Prepare OS versions shell: bash run: ${GITHUB_ACTION_PATH}/prepare_platform.sh ${{ inputs.platforms }} diff --git a/molecule/default/dockerfiles/ubuntu2404 b/molecule/default/dockerfiles/ubuntu2404 new file mode 100644 index 0000000..1ebee62 --- /dev/null +++ b/molecule/default/dockerfiles/ubuntu2404 @@ -0,0 +1,10 @@ +FROM ubuntu:24.04 + +RUN apt-get update \ + && apt-get install -y init gpg ca-certificates sudo curl \ + && apt-get clean all + +# Adding fake systemctl +RUN curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py -o /usr/local/bin/systemctl + +CMD ["/usr/local/bin/systemctl"] diff --git a/prepare_platform.sh b/prepare_platform.sh index d8447b8..e5ef461 100755 --- a/prepare_platform.sh +++ b/prepare_platform.sh @@ -24,7 +24,7 @@ This is a bash script to make generate a Molecule configutaion. exit fi -available_platforms=("al2" "al2023" "centos7" "centos8" "debian-bullseye" "debian-buster" "debian-bookworm" "redhat8" "redhat9" "suse15.2" "suse15.3" "suse15.4" "suse15.5" "ubuntu1604" "ubuntu1804" "ubuntu2004" "ubuntu2204") +available_platforms=("al2" "al2023" "centos7" "centos8" "debian-bullseye" "debian-buster" "debian-bookworm" "redhat8" "redhat9" "suse15.2" "suse15.3" "suse15.4" "suse15.5" "ubuntu1604" "ubuntu1804" "ubuntu2004" "ubuntu2204" "ubuntu2404") # check_platforms verifies that the provided platforms are available check_platforms() {