From ccaba43556701daa50844bfaeacc085a7cc2665f Mon Sep 17 00:00:00 2001 From: Federico Capoano Date: Fri, 5 Jul 2024 09:55:02 -0400 Subject: [PATCH] [feature] Added support for Ubuntu 24.04 and Debian 12 + CI updates * [feature] Added support for Ubuntu 24.04 and Debian * [ci] Avoid stopping build on QA checks failure * [ci] Updated OSes used in CI build * [chores] Added assets tag --------- Co-authored-by: Gagan Deep --- .github/workflows/ci.yml | 12 +++++---- README.md | 6 +++-- meta/main.yml | 2 +- molecule/default/molecule.yml | 3 ++- molecule/local/molecule.yml | 25 +++++++++++++++--- tasks/apt.yml | 49 +++++++++++++++++++++++++---------- tasks/yarn.yml | 1 + 7 files changed, 72 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0ad10d..a4d3878 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,14 +13,16 @@ on: # yamllint disable-line rule:truthy jobs: build: name: Build ${{ matrix.distro }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: distro: + - ubuntu2404 - ubuntu2204 - ubuntu2004 + - debian12 - debian11 steps: @@ -33,19 +35,19 @@ jobs: with: python-version: '3.x' - - name: Install python dependencies + - name: Install Dependencies + id: deps run: | pip install molecule molecule-plugins[docker] yamllint ansible-lint docker pip install openwisp-utils[qa] - - - name: Install Ansible Galaxy dependencies - run: ansible-galaxy collection install "community.general:>=3.6.0" + ansible-galaxy collection install "community.general:>=3.6.0" - name: QA checks run: | openwisp-qa-check --skip-isort --skip-flake8 --skip-checkmigrations --skip-black - name: Tests + if: ${{ !cancelled() && steps.deps.conclusion == 'success' }} run: | mkdir -p ~/.ansible/roles ln -s $GITHUB_WORKSPACE ~/.ansible/roles/openwisp.wifi_login_pages diff --git a/README.md b/README.md index 62476e9..3795453 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ansible-openwisp-wifi-login-pages -[![Build Status](https://github.com/openwisp/ansible-openwisp-wifi-login-pages/workflows/Ansible%20OpenWISP%20WiFi%20Login%20Pages%20CI%20Build/badge.svg?branch=master)](https://github.com/openwisp/ansible-openwisp-wifi-login-pages/actions) +[![Ansible OpenWISP WiFi Login Pages CI Build](https://github.com/openwisp/ansible-openwisp-wifi-login-pages/actions/workflows/ci.yml/badge.svg)](https://github.com/openwisp/ansible-openwisp-wifi-login-pages/actions/workflows/ci.yml) Ansible role to deploy and manage [openwisp-wifi-login-pages](https://github.com/openwisp/openwisp-wifi-login-pages). @@ -31,7 +31,7 @@ to install openwisp-wifi-login-pages. ### Install ansible -Install ansible (version 2.10 or higher) **on your local machine** (not the production server!) if +Install ansible (version 2.13 or higher) **on your local machine** (not the production server!) if you haven't done already. To **install ansible** we suggest you follow the official [ansible installation guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-in-a-virtual-environment-with-pip). It is recommended to install ansible through a virtual environment to avoid dependency issues. @@ -196,9 +196,11 @@ pip install molecule[docker] yamllint ansible-lint docker **Step 4**: Download docker images ``` +docker pull geerlingguy/docker-ubuntu2404-ansible:latest docker pull geerlingguy/docker-ubuntu2204-ansible:latest docker pull geerlingguy/docker-ubuntu2004-ansible:latest docker pull geerlingguy/docker-debian11-ansible:latest +docker pull geerlingguy/docker-debian12-ansible:latest ``` **Step 5**: Install ansible dependencies diff --git a/meta/main.yml b/meta/main.yml index df80c8c..2fffcc3 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -9,7 +9,7 @@ galaxy_info: author: OpenWISP company: OpenWISP description: Role to install and upgrade OpenWISP WiFi Login Pages - min_ansible_version: 2.10 + min_ansible_version: 2.13 issue_tracker_url: https://github.com/openwisp/openwisp-wifi-login-pages/issues platforms: - name: Debian diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 746b094..9496f5d 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -26,7 +26,8 @@ platforms: image: "geerlingguy/docker-${MOLECULE_DISTRO}-ansible:${tag:-latest}" command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + cgroupns_mode: host privileged: true pre_build_image: true provisioner: diff --git a/molecule/local/molecule.yml b/molecule/local/molecule.yml index e2ca471..d440f38 100644 --- a/molecule/local/molecule.yml +++ b/molecule/local/molecule.yml @@ -23,25 +23,44 @@ lint: | yamllint . || true ansible-lint || true platforms: + - name: "openwisp2-ubuntu2404" + image: "geerlingguy/docker-ubuntu2404-ansible:latest" + command: ${MOLECULE_DOCKER_COMMAND:-""} + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + cgroupns_mode: host + privileged: true + pre_build_image: true - name: "openwisp2-ubuntu2204" image: "geerlingguy/docker-ubuntu2204-ansible:latest" command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + cgroupns_mode: host privileged: true pre_build_image: true - name: "openwisp2-ubuntu2004" image: "geerlingguy/docker-ubuntu2004-ansible:latest" command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + cgroupns_mode: host privileged: true pre_build_image: true - name: "openwisp2-debian11" image: "geerlingguy/docker-debian11-ansible:latest" command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + cgroupns_mode: host + privileged: true + pre_build_image: true + - name: "openwisp2-debian12" + image: "geerlingguy/docker-debian12-ansible:latest" + command: ${MOLECULE_DOCKER_COMMAND:-""} + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:rw + cgroupns_mode: host privileged: true pre_build_image: true provisioner: diff --git a/tasks/apt.yml b/tasks/apt.yml index c6e88f1..e23f8c8 100644 --- a/tasks/apt.yml +++ b/tasks/apt.yml @@ -22,23 +22,39 @@ register: result until: result is success -- name: Add nodejs apt key - apt_key: - url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key - state: present +- name: NodeJS deb source + block: + - name: Download nodesource gpg key + get_url: + url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key + dest: /etc/apt/trusted.gpg.d/nodesource.asc + checksum: sha256:332d428848005f43bfc79b9578c55cd172f5f17ae38aa7d9328f03a24e21c13a + ignore_errors: true + retries: 5 + delay: 10 + register: result + until: result is success -- name: Add nodejs 20.x ppa for apt repo - apt_repository: - repo: "deb https://deb.nodesource.com/node_20.x {{ ansible_distribution_release.lower() }} main" + - name: Add nodejs 20.x ppa for apt repo + apt_repository: + repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/nodesource.asc] https://deb.nodesource.com/node_20.x nodistro main" -- name: Add yarn apt key - apt_key: - url: https://dl.yarnpkg.com/debian/pubkey.gpg - state: present +- name: Yarn deb source + block: + - name: Download dl.yarnpkg.com gpg key + ansible.builtin.get_url: + url: https://dl.yarnpkg.com/debian/pubkey.gpg + dest: /etc/apt/trusted.gpg.d/yarnpkg.asc + checksum: sha256:8550a7e298b523fffa899069754fc150f2ff74092701e4d4109edd1cd6d5327f + ignore_errors: true + retries: 5 + delay: 10 + register: result + until: result is success -- name: Add yarn ppa for apt repo - apt_repository: - repo: "deb https://dl.yarnpkg.com/debian/ stable main" + - name: Add nodejs 20.x ppa for apt repo + apt_repository: + repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/yarnpkg.asc] https://dl.yarnpkg.com/debian/ stable main" - name: Install nodejs and yarn apt: @@ -47,3 +63,8 @@ - nodejs - yarn state: latest + ignore_errors: true + retries: 5 + delay: 10 + register: result + until: result is success diff --git a/tasks/yarn.yml b/tasks/yarn.yml index f7930fc..c56d207 100644 --- a/tasks/yarn.yml +++ b/tasks/yarn.yml @@ -73,6 +73,7 @@ group: "{{ www_group }}" mode: 0640 failed_when: false + tags: [assets] - name: yarn build become: true