Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken test matrix #25

Merged
merged 9 commits into from
Jun 29, 2024
Merged
8 changes: 6 additions & 2 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ on:
push:
branches:
- master
paths-ignore:
- 'README.md'
pull_request:
branches:
- master
paths-ignore:
- 'README.md'
jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -35,8 +39,8 @@ jobs:
- geerlingguy/docker-ubuntu2404-ansible:latest
- geerlingguy/docker-ubuntu2204-ansible:latest
- geerlingguy/docker-ubuntu2004-ansible:latest
- geerlingguy/docker-ubuntu1804-ansible:latest
- geerlingguy/docker-ubuntu1604-ansible:latest
# - geerlingguy/docker-ubuntu1804-ansible:latest # No PHP 8.1 support
#- geerlingguy/docker-ubuntu1604-ansible:latest # No PHP 8.1 support
steps:
- name: checkout
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Install and configure PHP, typically for use with Drupal sites in Acro Media NGI

## Requirements

* Ubuntu LTS (18.04 or newer)
* Ubuntu LTS (20.04 or newer)


## Role Variables

#### `php_default_version`
* The default CLI version of php to set on the server.
* Defaults to `8.1`
* Defaults to `8.3`

#### `php_memory_limit`
* The default maximum memory limit
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
php_default_version: 8.1
php_default_version: 8.3
php_versions:
- "{{ php_default_version }}"
php_memory_limit: 256M
Expand Down
10 changes: 5 additions & 5 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ galaxy_info:
platforms:
- name: Ubuntu
versions:
- xenial
- bionic
- focal
- jammy
- noble
#- xenial # No php 8.1 support
# - bionic # No php 8.1 support
- focal
- jammy
- noble
galaxy_tags: []
dependencies: []
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
image: "${MOLECULE_DOCKER_IMAGE:-'geerlingguy/docker-ubuntu2204-ansible:latest'}"
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
volumes:
Expand Down
6 changes: 3 additions & 3 deletions molecule/default/vars.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
php_default_version: 8.1
php_default_version: 8.3
php_versions:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
php_use_legacy_module_lists: false # Don't use version-specific module lists; Apply 8.1-style package name list generator to all older PHP versions too.
35 changes: 33 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- set_fact:
_supported_ubuntu_versions:
- '18.04'
# - '16.04' # No php 8.1 support.
# - '18.04' # No php 8.1 support.
- '20.04'
- '22.04'
- '24.04'
Expand All @@ -22,11 +23,41 @@
debug:
var: ansible_distribution_release

- name: Add ondrej repo to allow multiple PHP versions
- name: Add ondrej repo to allow multiple PHP versions (except ubuntu 24.04)
apt_repository:
repo: "ppa:ondrej/php"
update_cache: yes
codename: "{{ ansible_distribution_release }}"
when: ansible_distribution_version != '24.04'

- name: Apply jenky workaround for ubuntu 24.04. See https://github.com/oerdnj/deb.sury.org/issues/1429
when: ansible_distribution_version == '24.04'
block:
- set_fact:
_gpgkey: 'B8DC7E53946656EFBCE4C1DD71DAEAAB4AD4CAB6'
_gpgkeypath: '/etc/apt/keyrings/ondrej-ubuntu-php-2404.asc'
- set_fact:
gpgurl: "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x{{ _gpgkey }}"
- name: Download the GPG key
get_url:
url: "{{ gpgurl }}"
dest: "{{ _gpgkeypath }}"
- name: Create the sources file
copy:
content: |
X-Repolib-Name: Ondrej PHP
Types: deb
URIs: https://ppa.launchpadcontent.net/ondrej/php/ubuntu
Suites: noble
Components: main
Signed-By: /etc/apt/keyrings/ondrej-ubuntu-php-2404.asc
dest: /etc/apt/sources.list.d/ondrej-ubuntu-php-2404.sources
force: true
register: manual_php_2404_sources_file_result
- name: Update apt cache
apt:
update_cache: yes
when: manual_php_2404_sources_file_result.changed

- name: Debug php_versions
debug:
Expand Down
Loading