diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91d8558..2ecf63b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index cfd093e..a976f60 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -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 diff --git a/vars/Debian.yml b/vars/Debian.yml index 348ab17..06a7626 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -48,3 +48,4 @@ php_versions_debian: - php8.1-common - php8.2-common - php8.3-common + - php8.4-common