Skip to content

Commit b09afd4

Browse files
committed
Issue #94: Try to get new deb822_repository task to work properly.
1 parent 26cba96 commit b09afd4

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ galaxy_info:
88
company: "Midwestern Mac, LLC"
99
license: "MIT"
1010
issue_tracker_url: https://github.com/geerlingguy/ansible-role-php-versions/issues
11-
min_ansible_version: 2.10
11+
min_ansible_version: 2.15
1212
platforms:
1313
- name: Debian
1414
versions:

tasks/setup-Debian.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
- python3-debian
1212
state: present
1313

14+
# Huge thanks to https://www.jeffgeerling.com/comment/34112#comment-34112
1415
- name: Make API request to Launchpad
1516
uri:
1617
url: "https://api.launchpad.net/devel/~ondrej/+archive/ubuntu/php"
17-
return_content: yes
18+
return_content: true
1819
method: GET
1920
headers:
2021
Accept: "application/json"
@@ -24,6 +25,13 @@
2425
ansible.builtin.set_fact:
2526
signing_key_fingerprint: "{{ launchpad_response.json.signing_key_fingerprint }}"
2627

28+
- name: Retrieve ASCII representation of the key using the signing key fingerprint
29+
uri:
30+
url: "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x{{ signing_key_fingerprint }}"
31+
return_content: true
32+
method: GET
33+
register: keyserver_response
34+
2735
- name: Add Ondrej's PHP PPA
2836
become: true
2937
ansible.builtin.deb822_repository:
@@ -33,14 +41,14 @@
3341
uris: [https://ppa.launchpadcontent.net/ondrej/php/ubuntu]
3442
suites: ["{{ ansible_facts['distribution_release'] }}"]
3543
components: [main]
36-
signed_by: "{{ signing_key_fingerprint }}"
44+
signed_by: "{{ keyserver_response.content }}"
3745
register: php_ondrej_debian_repo
3846

39-
- name: Update apt caches after repo is added (Debian).
47+
- name: Update apt caches after repo is added.
4048
apt: update_cache=true
4149
when:
4250
- php_ondrej_debian_repo.changed
43-
- ansible_distribution == "Debian"
51+
- ansible_os_family == "Debian"
4452
tags: ['skip_ansible_lint']
4553

4654
- name: Purge PHP version packages (besides the currently chosen php_version).

0 commit comments

Comments
 (0)