Skip to content

Commit 26cba96

Browse files
committed
Attempt to fix Debian and Ubuntu builds for modern Ansible.
1 parent 79a9817 commit 26cba96

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,20 @@ jobs:
4444
# Default PHP version.
4545
- distro: rockylinux9
4646
playbook: converge.yml
47-
- distro: ubuntu2204
47+
- distro: ubuntu2404
4848
playbook: converge.yml
49-
- distro: debian11
49+
- distro: debian12
5050
playbook: converge.yml
5151

5252
# PHP 8.2.
5353
- distro: rockylinux9
5454
playbook: 8.2.yml
55-
- distro: ubuntu2204
55+
- distro: ubuntu2404
5656
playbook: 8.2.yml
57-
- distro: debian11
57+
- distro: debian12
5858
playbook: 8.2.yml
5959

6060
# PHP 7.4.
61-
- distro: rockylinux9
62-
playbook: 7.4.yml
6361
- distro: ubuntu2004
6462
playbook: 7.4.yml
6563
- distro: debian11

tasks/setup-Debian.yml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,38 @@
33
set_fact:
44
php_opcache_conf_filename: "10-opcache.ini"
55

6-
- name: Ensure dirmngr is installed (gnupg dependency).
7-
apt:
8-
name: dirmngr
9-
state: present
10-
11-
- name: Add repository for PHP versions (Ubuntu).
12-
apt_repository: repo='ppa:ondrej/php'
13-
when: ansible_distribution == "Ubuntu"
14-
15-
# Debian-specific tasks.
16-
- name: Add dependencies for PHP versions (Debian).
6+
- name: Add dependencies for PHP versions.
177
apt:
188
name:
199
- apt-transport-https
2010
- ca-certificates
11+
- python3-debian
2112
state: present
22-
when: ansible_distribution == "Debian"
23-
24-
- name: Add Ondrej Sury's apt key (Debian).
25-
apt_key:
26-
url: https://packages.sury.org/php/apt.gpg
27-
id: 15058500A0235D97F5D10063B188E2B695BD4743
28-
state: present
29-
when: ansible_distribution == "Debian"
3013

31-
- name: Add Ondrej Sury's repo (Debian).
32-
apt_repository:
33-
repo: "deb https://packages.sury.org/php/ {{ ansible_distribution_release }} main"
14+
- name: Make API request to Launchpad
15+
uri:
16+
url: "https://api.launchpad.net/devel/~ondrej/+archive/ubuntu/php"
17+
return_content: yes
18+
method: GET
19+
headers:
20+
Accept: "application/json"
21+
register: launchpad_response
22+
23+
- name: Parse JSON to extract signing key fingerprint
24+
ansible.builtin.set_fact:
25+
signing_key_fingerprint: "{{ launchpad_response.json.signing_key_fingerprint }}"
26+
27+
- name: Add Ondrej's PHP PPA
28+
become: true
29+
ansible.builtin.deb822_repository:
3430
state: present
31+
name: "ondrej-php-{{ ansible_distribution_release }}"
32+
types: [deb]
33+
uris: [https://ppa.launchpadcontent.net/ondrej/php/ubuntu]
34+
suites: ["{{ ansible_facts['distribution_release'] }}"]
35+
components: [main]
36+
signed_by: "{{ signing_key_fingerprint }}"
3537
register: php_ondrej_debian_repo
36-
when: ansible_distribution == "Debian"
3738

3839
- name: Update apt caches after repo is added (Debian).
3940
apt: update_cache=true

vars/Debian.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ php_versions_debian:
4848
- php8.1-common
4949
- php8.2-common
5050
- php8.3-common
51+
- php8.4-common

0 commit comments

Comments
 (0)