From b8594edf8c02a9380eba3c5cee8a8ba8093b21fd Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Mon, 15 Jul 2024 19:17:41 +0200 Subject: [PATCH] feat: Add support for Alpine Linux 3.20 --- CHANGELOG.md | 4 ++++ README.md | 3 ++- molecule/agent/cleanup.yml | 2 +- molecule/agent/molecule.yml | 8 ++++++++ molecule/default/molecule.yml | 8 ++++++++ molecule/distribution/molecule.yml | 8 ++++++++ molecule/downgrade/molecule.yml | 10 +++++++++- molecule/source-version/converge.yml | 8 ++++++-- molecule/source-version/molecule.yml | 13 +++++++++++++ molecule/source-version/verify.yml | 2 +- molecule/source/molecule.yml | 8 ++++++++ molecule/stable/molecule.yml | 8 ++++++++ molecule/uninstall/molecule.yml | 8 ++++++++ molecule/upgrade/molecule.yml | 10 +++++++++- molecule/version/converge.yml | 16 ++++++++-------- molecule/version/molecule.yml | 8 ++++++++ vars/main.yml | 2 +- 17 files changed, 110 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b65e9dd7..a252fd001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ BREAKING CHANGES: - Remove support for RHEL 7 based distributions (RHEL/CentOS/Oracle Linux 7). CentOS 7 has reached EoL, RHEL 7 has reached EoM, and Oracle Linux 7 will reach EoL shortly. These distributions will not be supported by new NGINX releases moving forward. If you are still using one of these distributions, please consider upgrading. If you still want to use this role for the time being, please use the previous release (0.24.3). Do note that you will only be able to use NGINX versions released as of the date of the aforementioned release (July 11, 2024). - Remove support for installing NGINX Open Source on Alpine Linux 3.16. +FEATURES: + +- Add support for installing NGINX Open Source on Alpine Linux 3.20. + ## 0.24.3 (July 11, 2024) DEPRECATION WARNINGS: diff --git a/README.md b/README.md index 3f42a4a86..f7678b379 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ Alpine: - 3.17 - 3.18 - 3.19 + - 3.20 Amazon Linux: - 2 - 2023 @@ -185,10 +186,10 @@ AlmaLinux: - 8 - 9 Alpine: - - 3.16 - 3.17 - 3.18 - 3.19 + - 3.20 Amazon Linux: - 2 - 2023 diff --git a/molecule/agent/cleanup.yml b/molecule/agent/cleanup.yml index 3e5d65b51..502f5b0e7 100644 --- a/molecule/agent/cleanup.yml +++ b/molecule/agent/cleanup.yml @@ -25,7 +25,7 @@ - name: Get list of NGINX One dangling instance IDs ansible.builtin.uri: - url: https://{{ lookup('env', 'ONE_TENANT') }}.console.ves.volterra.io/api/nginx/one/namespaces/default/instances?paginated=false&filter_fields=hostname&filter_ops=IN&filter_values=almalinux-8|almalinux-9|alpine-3.17|alpine-3.18|alpine-3.19|amazonlinux-2|debian-bullseye|debian-bookworm|oraclelinux-8|oraclelinux-9|rhel-8|rhel-9|rockylinux-8|rockylinux-9|sles-15|ubuntu-focal|ubuntu-jammy + url: https://{{ lookup('env', 'ONE_TENANT') }}.console.ves.volterra.io/api/nginx/one/namespaces/default/instances?paginated=false&filter_fields=hostname&filter_ops=IN&filter_values=almalinux-8|almalinux-9|alpine-3.17|alpine-3.18|alpine-3.19|alpine-3.20|amazonlinux-2|debian-bullseye|debian-bookworm|oraclelinux-8|oraclelinux-9|rhel-8|rhel-9|rockylinux-8|rockylinux-9|sles-15|ubuntu-focal|ubuntu-jammy method: GET headers: Authorization: APIToken {{ lookup('env', 'ONE_API_TOKEN') }} diff --git a/molecule/agent/molecule.yml b/molecule/agent/molecule.yml index 7d4bd6a53..4f0800304 100644 --- a/molecule/agent/molecule.yml +++ b/molecule/agent/molecule.yml @@ -43,6 +43,14 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw command: /sbin/init + - name: alpine-3.20 + image: alpine:3.20 + dockerfile: ../common/Dockerfile.j2 + privileged: true + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + command: /sbin/init - name: amazonlinux-2 image: amazonlinux:2 platform: x86_64 diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 34c3de3c9..ecdf06cd1 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -43,6 +43,14 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw command: /sbin/init + - name: alpine-3.20 + image: alpine:3.20 + dockerfile: ../common/Dockerfile.j2 + privileged: true + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + command: /sbin/init - name: amazonlinux-2 image: amazonlinux:2 platform: x86_64 diff --git a/molecule/distribution/molecule.yml b/molecule/distribution/molecule.yml index 34c3de3c9..ecdf06cd1 100644 --- a/molecule/distribution/molecule.yml +++ b/molecule/distribution/molecule.yml @@ -43,6 +43,14 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw command: /sbin/init + - name: alpine-3.20 + image: alpine:3.20 + dockerfile: ../common/Dockerfile.j2 + privileged: true + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + command: /sbin/init - name: amazonlinux-2 image: amazonlinux:2 platform: x86_64 diff --git a/molecule/downgrade/molecule.yml b/molecule/downgrade/molecule.yml index 484bf8e3d..ad87cfed9 100644 --- a/molecule/downgrade/molecule.yml +++ b/molecule/downgrade/molecule.yml @@ -1,7 +1,7 @@ --- driver: name: docker -platforms: +platforms: # Alpine 3.20 only has one version of NGINX OSS available (at the moment) so it's impossible to test the downgrade scenario - name: almalinux-8 image: almalinux:8 dockerfile: ../common/Dockerfile.j2 @@ -43,6 +43,14 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw command: /sbin/init + # - name: alpine-3.20 + # image: alpine:3.20 + # dockerfile: ../common/Dockerfile.j2 + # privileged: true + # cgroupns_mode: host + # volumes: + # - /sys/fs/cgroup:/sys/fs/cgroup:rw + # command: /sbin/init - name: amazonlinux-2 image: amazonlinux:2 platform: x86_64 diff --git a/molecule/source-version/converge.yml b/molecule/source-version/converge.yml index 34e2fc8e9..e66acb235 100644 --- a/molecule/source-version/converge.yml +++ b/molecule/source-version/converge.yml @@ -1,14 +1,18 @@ --- - name: Converge hosts: all + pre_tasks: + - name: Set NGINX version + ansible.builtin.set_fact: + ngx_version: 1.26.1 + cacheable: true tasks: - name: Install NGINX from source ansible.builtin.include_role: name: ansible-role-nginx vars: nginx_install_from: source - nginx_branch: stable - nginx_version: "1.25.1" + nginx_version: "{{ ngx_version }}" nginx_static_modules: [http_ssl_module] nginx_install_source_build_tools: true nginx_install_source_pcre: false diff --git a/molecule/source-version/molecule.yml b/molecule/source-version/molecule.yml index 34c3de3c9..2ad15b9ad 100644 --- a/molecule/source-version/molecule.yml +++ b/molecule/source-version/molecule.yml @@ -43,6 +43,14 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw command: /sbin/init + - name: alpine-3.20 + image: alpine:3.20 + dockerfile: ../common/Dockerfile.j2 + privileged: true + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + command: /sbin/init - name: amazonlinux-2 image: amazonlinux:2 platform: x86_64 @@ -175,3 +183,8 @@ provisioner: playbooks: converge: converge.yml verify: verify.yml + config_options: + defaults: + fact_caching: jsonfile + fact_caching_connection: /tmp/facts_cache + fact_caching_timeout: 7200 diff --git a/molecule/source-version/verify.yml b/molecule/source-version/verify.yml index 631716dfe..89ca6b81f 100644 --- a/molecule/source-version/verify.yml +++ b/molecule/source-version/verify.yml @@ -22,4 +22,4 @@ chdir: "{{ ((ansible_facts['system'] | lower is not search('bsd')) | ternary('/etc/nginx', '/usr/local/sbin')) }}" changed_when: false register: version - failed_when: version is not search('1.25.1') + failed_when: version is not search(ngx_version | regex_search('([0-9]+\\.){2}[0-9]+')) diff --git a/molecule/source/molecule.yml b/molecule/source/molecule.yml index 34c3de3c9..ecdf06cd1 100644 --- a/molecule/source/molecule.yml +++ b/molecule/source/molecule.yml @@ -43,6 +43,14 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw command: /sbin/init + - name: alpine-3.20 + image: alpine:3.20 + dockerfile: ../common/Dockerfile.j2 + privileged: true + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + command: /sbin/init - name: amazonlinux-2 image: amazonlinux:2 platform: x86_64 diff --git a/molecule/stable/molecule.yml b/molecule/stable/molecule.yml index 34c3de3c9..ecdf06cd1 100644 --- a/molecule/stable/molecule.yml +++ b/molecule/stable/molecule.yml @@ -43,6 +43,14 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw command: /sbin/init + - name: alpine-3.20 + image: alpine:3.20 + dockerfile: ../common/Dockerfile.j2 + privileged: true + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + command: /sbin/init - name: amazonlinux-2 image: amazonlinux:2 platform: x86_64 diff --git a/molecule/uninstall/molecule.yml b/molecule/uninstall/molecule.yml index 015fa352d..69ba5c6d8 100644 --- a/molecule/uninstall/molecule.yml +++ b/molecule/uninstall/molecule.yml @@ -43,6 +43,14 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw command: /sbin/init + - name: alpine-3.20 + image: alpine:3.20 + dockerfile: ../common/Dockerfile.j2 + privileged: true + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + command: /sbin/init - name: amazonlinux-2 image: amazonlinux:2 platform: x86_64 diff --git a/molecule/upgrade/molecule.yml b/molecule/upgrade/molecule.yml index 015fa352d..f02658884 100644 --- a/molecule/upgrade/molecule.yml +++ b/molecule/upgrade/molecule.yml @@ -1,7 +1,7 @@ --- driver: name: docker -platforms: +platforms: # Alpine 3.20 only has one version of NGINX OSS available (at the moment) so it's impossible to test the upgrade scenario - name: almalinux-8 image: almalinux:8 dockerfile: ../common/Dockerfile.j2 @@ -43,6 +43,14 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw command: /sbin/init + # - name: alpine-3.20 + # image: alpine:3.20 + # dockerfile: ../common/Dockerfile.j2 + # privileged: true + # cgroupns_mode: host + # volumes: + # - /sys/fs/cgroup:/sys/fs/cgroup:rw + # command: /sbin/init - name: amazonlinux-2 image: amazonlinux:2 platform: x86_64 diff --git a/molecule/version/converge.yml b/molecule/version/converge.yml index bb2b1fc6e..dcecb549f 100644 --- a/molecule/version/converge.yml +++ b/molecule/version/converge.yml @@ -4,26 +4,26 @@ pre_tasks: - name: Set repo if Alpine ansible.builtin.set_fact: - ngx_version: =1.25.5-r1 - njs_version: =1.25.5.0.8.4-r3 + ngx_version: =1.27.0-r2 + njs_version: =1.27.0.0.8.5-r2 cacheable: true when: ansible_facts['os_family'] == "Alpine" - name: Set repo if Debian ansible.builtin.set_fact: - ngx_version: =1.25.5-1~{{ ansible_facts['distribution_release'] }} - njs_version: =1.25.5+0.8.4-3~{{ ansible_facts['distribution_release'] }} + ngx_version: =1.27.0-2~{{ ansible_facts['distribution_release'] }} + njs_version: =1.27.0+0.8.5-2~{{ ansible_facts['distribution_release'] }} cacheable: true when: ansible_facts['os_family'] == "Debian" - name: Set repo if Red Hat ansible.builtin.set_fact: - ngx_version: -1.25.5-1.{{ (ansible_facts['distribution'] == "Amazon") | ternary(('amzn' + ansible_facts['distribution_major_version'] | string), ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx - njs_version: -1.25.5+0.8.4-3.{{ (ansible_facts['distribution'] == "Amazon") | ternary(('amzn' + ansible_facts['distribution_major_version'] | string), ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx + ngx_version: -1.27.0-2.{{ (ansible_facts['distribution'] == "Amazon") | ternary(('amzn' + ansible_facts['distribution_major_version'] | string), ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx + njs_version: -1.27.0+0.8.5-2.{{ (ansible_facts['distribution'] == "Amazon") | ternary(('amzn' + ansible_facts['distribution_major_version'] | string), ('el' + ansible_facts['distribution_major_version'] | string)) }}.ngx cacheable: true when: ansible_facts['os_family'] == "RedHat" - name: Set repo if SLES ansible.builtin.set_fact: - ngx_version: =1.25.5-1.sles{{ ansible_facts['distribution_major_version'] }}.ngx - njs_version: =1.25.5+0.8.4-3.sles{{ ansible_facts['distribution_major_version'] }}.ngx + ngx_version: =1.27.0-2.sles{{ ansible_facts['distribution_major_version'] }}.ngx + njs_version: =1.27.0+0.8.5-2.sles{{ ansible_facts['distribution_major_version'] }}.ngx cacheable: true when: ansible_facts['os_family'] == "Suse" tasks: diff --git a/molecule/version/molecule.yml b/molecule/version/molecule.yml index 04685e1c0..2ad15b9ad 100644 --- a/molecule/version/molecule.yml +++ b/molecule/version/molecule.yml @@ -43,6 +43,14 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw command: /sbin/init + - name: alpine-3.20 + image: alpine:3.20 + dockerfile: ../common/Dockerfile.j2 + privileged: true + cgroupns_mode: host + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + command: /sbin/init - name: amazonlinux-2 image: amazonlinux:2 platform: x86_64 diff --git a/vars/main.yml b/vars/main.yml index b198180b5..dc9b2633c 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -27,7 +27,7 @@ nginx_supported_distributions: architectures: [x86_64, aarch64, s390x] alpine: name: Alpine Linux - versions: [3.17, 3.18, 3.19] + versions: [3.17, 3.18, 3.19, 3.20] architectures: [x86_64, aarch64] amazon: name: Amazon Linux