Files
php/tasks/requirements.yml

44 lines
1.2 KiB
YAML

---
- name: php | apt update cache
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 86400
- name: php | install requirements
ansible.builtin.apt:
name:
- apt-transport-https
- lsb-release
- ca-certificates
- curl
- gnupg
state: present
- name: php | ensure apt keyring directory exists
ansible.builtin.file:
path: /usr/share/keyrings
state: directory
mode: '0755'
- name: php | download Sury PHP GPG key (ASCII)
ansible.builtin.get_url:
url: https://packages.sury.org/php/apt.gpg
dest: /usr/share/keyrings/sury-php-archive-keyring.asc
mode: '0644'
- name: php | dearmor Sury PHP GPG key
ansible.builtin.command:
cmd: gpg --dearmor -o /usr/share/keyrings/sury-php-archive-keyring.gpg /usr/share/keyrings/sury-php-archive-keyring.asc
args:
creates: /usr/share/keyrings/sury-php-archive-keyring.gpg
- name: php | add Sury PHP APT repository (signed-by)
ansible.builtin.apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/sury-php-archive-keyring.gpg] https://packages.sury.org/php/ {{ ansible_distribution_release }} main"
state: present
filename: php-sury
- name: php | apt update cache after adding repo
ansible.builtin.apt:
update_cache: yes