blob: 7b7c6a5b50bf731c70a7752a8d5bab46379ab051 [file] [log] [blame]
Zack Williams15c09e72020-10-14 21:30:57 -07001---
2# php tasks/Debian.yml
3#
4# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
5# SPDX-License-Identifier: Apache-2.0
6
7# PHP from this PPA for Ubuntu: https://launchpad.net/~ondrej/+archive/ubuntu/php
8- name: Add PHP apt repo GPG key (Ubuntu)
9 when: 'ansible_distribution == "Ubuntu"'
10 apt_key:
11 data: "{{ lookup('file','ubuntu_ondrej_php_ppa.key') }}"
12 state: "present"
13
14- name: Add PHP apt repo (Ubuntu)
15 when: 'ansible_distribution == "Ubuntu"'
16 apt_repository:
17 repo: >-
18 deb http://ppa.launchpad.net/ondrej/php/{{ ansible_lsb['id'] | lower }}
19 {{ ansible_lsb['codename'] }} main
20 update_cache: true
21
22# PHP from this apt repo for Debian: https://deb.sury.org/
23- name: Add PHP apt repo GPG key (Debian)
24 when: 'ansible_distribution == "Debian"'
25 apt_key:
26 data: "{{ lookup('file','debian_packages_sury_org_php.gpg') }}"
27 state: "present"
28
29- name: Add PHP apt repo (Debian)
30 when: 'ansible_distribution == "Debian"'
31 apt_repository:
32 repo: "deb https://packages.sury.org/php/ {{ ansible_lsb['codename'] }} main"
33 update_cache: true
34
35- name: Install PHP packages
36 apt:
37 name: "{{ php_packages }}"
38 state: "present"
39 update_cache: true
40 cache_valid_time: 3600
41 notify:
42 - start-php