2014-08-16 23:35:57 +02:00
|
|
|
---
|
2020-07-14 08:45:33 +02:00
|
|
|
# Ubuntu 18.04 uses php-fpm 7.2
|
|
|
|
# Debian 10 uses php-fpm 7.3
|
|
|
|
# Ubuntu 20.04 uses PHP 7.4
|
2021-09-06 20:19:57 +02:00
|
|
|
# Debian 11 uses PHP 7.4
|
2014-08-16 23:35:57 +02:00
|
|
|
|
2021-09-08 08:32:06 +02:00
|
|
|
# If any of the vhosts on this host need WordPress then we need to install PHP.
|
|
|
|
# This uses selectattr to filter the list of dicts in nginx_vhosts, selecting
|
|
|
|
# any that have has_wordpress defined, and has_wordpress set to True.
|
|
|
|
#
|
|
|
|
# See: https://stackoverflow.com/a/31896249
|
|
|
|
- name: Check if any vhost needs WordPress
|
|
|
|
set_fact:
|
|
|
|
install_php: True
|
|
|
|
when: "nginx_vhosts | selectattr('has_wordpress', 'defined') | selectattr('has_wordpress', 'equalto', True) | list | length > 0"
|
|
|
|
|
|
|
|
# Legacy, was only for Piwik, but leaving for now.
|
|
|
|
- name: Check if any vhost needs PHP
|
|
|
|
set_fact:
|
|
|
|
install_php: True
|
|
|
|
when: "nginx_vhosts | selectattr('needs_php', 'defined') | selectattr('needs_php', 'equalto', True) | list | length > 0"
|
|
|
|
|
|
|
|
# If install_php has not been set, then we assume no vhosts need PHP. This is
|
|
|
|
# a bit hacky, but it's the closest we come to an if/then/else.
|
|
|
|
- name: Set install_php to False
|
|
|
|
set_fact:
|
|
|
|
install_php: False
|
|
|
|
when: install_php is not defined
|
|
|
|
|
2018-03-18 21:26:46 +01:00
|
|
|
- name: Configure php-fpm on Ubuntu 18.04
|
2018-03-18 21:29:52 +01:00
|
|
|
include_tasks: Ubuntu_18.04.yml
|
2021-09-08 08:32:06 +02:00
|
|
|
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('18.04', '==') and install_php
|
2018-03-18 21:26:46 +01:00
|
|
|
tags: php-fpm
|
|
|
|
|
2019-07-06 20:04:04 +02:00
|
|
|
- name: Configure php-fpm on Debian 10
|
|
|
|
include_tasks: Debian_10.yml
|
2021-09-08 08:32:06 +02:00
|
|
|
when: ansible_distribution == 'Debian' and ansible_distribution_version is version('10', '==') and install_php
|
2019-07-06 20:04:04 +02:00
|
|
|
tags: php-fpm
|
|
|
|
|
2020-07-13 22:25:32 +02:00
|
|
|
- name: Configure php-fpm on Ubuntu 20.04
|
|
|
|
include_tasks: Ubuntu_20.04.yml
|
2021-09-08 08:32:06 +02:00
|
|
|
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('20.04', '==') and install_php
|
2020-07-13 22:25:32 +02:00
|
|
|
tags: php-fpm
|
|
|
|
|
2021-09-06 20:19:57 +02:00
|
|
|
- name: Configure php-fpm on Debian 11
|
|
|
|
include_tasks: Ubuntu_20.04.yml
|
2021-09-08 08:32:06 +02:00
|
|
|
when: ansible_distribution == 'Debian' and ansible_distribution_version is version('11', '==') and install_php
|
2021-09-06 20:19:57 +02:00
|
|
|
tags: php-fpm
|
|
|
|
|
2014-08-16 23:35:57 +02:00
|
|
|
# vim: set ts=2 sw=2:
|