Attempt to fix Debian and Ubuntu builds for modern Ansible.

This commit is contained in:
Jeff Geerling 2025-01-29 22:50:12 -06:00
parent 79a9817559
commit 26cba968b8
3 changed files with 28 additions and 28 deletions

View File

@ -44,22 +44,20 @@ jobs:
# Default PHP version.
- distro: rockylinux9
playbook: converge.yml
- distro: ubuntu2204
- distro: ubuntu2404
playbook: converge.yml
- distro: debian11
- distro: debian12
playbook: converge.yml
# PHP 8.2.
- distro: rockylinux9
playbook: 8.2.yml
- distro: ubuntu2204
- distro: ubuntu2404
playbook: 8.2.yml
- distro: debian11
- distro: debian12
playbook: 8.2.yml
# PHP 7.4.
- distro: rockylinux9
playbook: 7.4.yml
- distro: ubuntu2004
playbook: 7.4.yml
- distro: debian11

View File

@ -3,37 +3,38 @@
set_fact:
php_opcache_conf_filename: "10-opcache.ini"
- name: Ensure dirmngr is installed (gnupg dependency).
apt:
name: dirmngr
state: present
- name: Add repository for PHP versions (Ubuntu).
apt_repository: repo='ppa:ondrej/php'
when: ansible_distribution == "Ubuntu"
# Debian-specific tasks.
- name: Add dependencies for PHP versions (Debian).
- name: Add dependencies for PHP versions.
apt:
name:
- apt-transport-https
- ca-certificates
- python3-debian
state: present
when: ansible_distribution == "Debian"
- name: Add Ondrej Sury's apt key (Debian).
apt_key:
url: https://packages.sury.org/php/apt.gpg
id: 15058500A0235D97F5D10063B188E2B695BD4743
state: present
when: ansible_distribution == "Debian"
- name: Make API request to Launchpad
uri:
url: "https://api.launchpad.net/devel/~ondrej/+archive/ubuntu/php"
return_content: yes
method: GET
headers:
Accept: "application/json"
register: launchpad_response
- name: Add Ondrej Sury's repo (Debian).
apt_repository:
repo: "deb https://packages.sury.org/php/ {{ ansible_distribution_release }} main"
- name: Parse JSON to extract signing key fingerprint
ansible.builtin.set_fact:
signing_key_fingerprint: "{{ launchpad_response.json.signing_key_fingerprint }}"
- name: Add Ondrej's PHP PPA
become: true
ansible.builtin.deb822_repository:
state: present
name: "ondrej-php-{{ ansible_distribution_release }}"
types: [deb]
uris: [https://ppa.launchpadcontent.net/ondrej/php/ubuntu]
suites: ["{{ ansible_facts['distribution_release'] }}"]
components: [main]
signed_by: "{{ signing_key_fingerprint }}"
register: php_ondrej_debian_repo
when: ansible_distribution == "Debian"
- name: Update apt caches after repo is added (Debian).
apt: update_cache=true

View File

@ -48,3 +48,4 @@ php_versions_debian:
- php8.1-common
- php8.2-common
- php8.3-common
- php8.4-common