role-php/tasks/install.yml

37 lines
892 B
YAML

---
- block:
- name: Add PHP GPG Key
apt_key:
url: "{{ php_apt_key_url }}"
state: present
- name: Add PHP Repository
apt_repository:
repo: "{{ php_apt_repo }}"
state: present
- name: Update apt cache
apt:
cache_valid_time: 3600
update_cache: true
register: _pre_update_apt_cache
until: _pre_update_apt_cache is succeeded
when:
- ansible_pkg_mgr == "apt"
- name: Uninstall old Version Packages
package:
name: "{{ php_del_libs }}"
state: absent
- name: Install PHP Packages
package:
name: "{{ php_libs }}"
state: present
update_cache: true
register: _install_packages
until: _install_packages is succeeded
retries: 5
delay: 2
when: (not php_version_check|bool) or (php_active_version != php_version)