|
@@ -12,6 +12,9 @@
|
|
- 'php5-pgsql'
|
|
- 'php5-pgsql'
|
|
- 'php5-sqlite'
|
|
- 'php5-sqlite'
|
|
when: with_php and ansible_lsb.major_release|int <= 8
|
|
when: with_php and ansible_lsb.major_release|int <= 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install common PHP dependencies (Debian >= 9)'
|
|
- name: 'Install common PHP dependencies (Debian >= 9)'
|
|
apt:
|
|
apt:
|
|
@@ -27,6 +30,9 @@
|
|
- 'php{{ php_version }}-pgsql'
|
|
- 'php{{ php_version }}-pgsql'
|
|
- 'php{{ php_version }}-sqlite3'
|
|
- 'php{{ php_version }}-sqlite3'
|
|
when: with_php and ansible_lsb.major_release|int >= 9
|
|
when: with_php and ansible_lsb.major_release|int >= 9
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Create PHP log directory'
|
|
- name: 'Create PHP log directory'
|
|
file:
|
|
file:
|
|
@@ -34,8 +40,11 @@
|
|
state: directory
|
|
state: directory
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0755
|
|
|
|
|
|
+ mode: '0755'
|
|
when: with_fpm
|
|
when: with_fpm
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install PHP configuration for syslog'
|
|
- name: 'Install PHP configuration for syslog'
|
|
template:
|
|
template:
|
|
@@ -43,13 +52,17 @@
|
|
dest: '{{ item.dest }}'
|
|
dest: '{{ item.dest }}'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
with_items:
|
|
with_items:
|
|
- { src: 'rsyslog/php-errors.conf.j2', dest: '/etc/rsyslog.d/php-errors.conf' }
|
|
- { src: 'rsyslog/php-errors.conf.j2', dest: '/etc/rsyslog.d/php-errors.conf' }
|
|
- { src: 'logrotate/php-errors.j2', dest: '/etc/logrotate.d/php-errors' }
|
|
- { src: 'logrotate/php-errors.j2', dest: '/etc/logrotate.d/php-errors' }
|
|
notify:
|
|
notify:
|
|
- 'Reload rsyslog for php'
|
|
- 'Reload rsyslog for php'
|
|
when: with_fpm
|
|
when: with_fpm
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
+
|
|
|
|
|
|
- name: 'Install local PHP configuration overrides for php5-cli (Debian 8)'
|
|
- name: 'Install local PHP configuration overrides for php5-cli (Debian 8)'
|
|
template:
|
|
template:
|
|
@@ -57,8 +70,11 @@
|
|
dest: '/etc/php5/cli/conf.d/99-local-config.ini'
|
|
dest: '/etc/php5/cli/conf.d/99-local-config.ini'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
when: with_php and ansible_lsb.major_release|int == 8
|
|
when: with_php and ansible_lsb.major_release|int == 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install local PHP configuration overrides for php{{ php_version }}-cli (Debian >= 9)'
|
|
- name: 'Install local PHP configuration overrides for php{{ php_version }}-cli (Debian >= 9)'
|
|
template:
|
|
template:
|
|
@@ -66,8 +82,11 @@
|
|
dest: '/etc/php/{{php_version }}/cli/conf.d/99-local-config.ini'
|
|
dest: '/etc/php/{{php_version }}/cli/conf.d/99-local-config.ini'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
when: with_php and ansible_lsb.major_release|int >= 9
|
|
when: with_php and ansible_lsb.major_release|int >= 9
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install Apache2 module for php5'
|
|
- name: 'Install Apache2 module for php5'
|
|
apt:
|
|
apt:
|
|
@@ -76,6 +95,9 @@
|
|
notify:
|
|
notify:
|
|
- 'Reload apache2'
|
|
- 'Reload apache2'
|
|
when: with_modphp5
|
|
when: with_modphp5
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install Apache2 module for php{{ php_version }}'
|
|
- name: 'Install Apache2 module for php{{ php_version }}'
|
|
apt:
|
|
apt:
|
|
@@ -84,6 +106,9 @@
|
|
notify:
|
|
notify:
|
|
- 'Reload apache2'
|
|
- 'Reload apache2'
|
|
when: with_modphp
|
|
when: with_modphp
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install local PHP configuration (Debian < 8)'
|
|
- name: 'Install local PHP configuration (Debian < 8)'
|
|
template:
|
|
template:
|
|
@@ -91,10 +116,13 @@
|
|
dest: '/etc/php5/conf.d/99-local-config.ini'
|
|
dest: '/etc/php5/conf.d/99-local-config.ini'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
notify:
|
|
notify:
|
|
- 'Reload apache2'
|
|
- 'Reload apache2'
|
|
when: with_modphp5 and ansible_lsb.major_release|int < 8
|
|
when: with_modphp5 and ansible_lsb.major_release|int < 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install local PHP configuration for Apache 2 (Debian 8)'
|
|
- name: 'Install local PHP configuration for Apache 2 (Debian 8)'
|
|
template:
|
|
template:
|
|
@@ -102,10 +130,13 @@
|
|
dest: '/etc/php5/apache2/conf.d/99-local-config.ini'
|
|
dest: '/etc/php5/apache2/conf.d/99-local-config.ini'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
notify:
|
|
notify:
|
|
- 'Reload apache2'
|
|
- 'Reload apache2'
|
|
when: with_modphp5 and ansible_lsb.major_release|int == 8
|
|
when: with_modphp5 and ansible_lsb.major_release|int == 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install local PHP configuration for Apache 2 (Debian >= 9)'
|
|
- name: 'Install local PHP configuration for Apache 2 (Debian >= 9)'
|
|
template:
|
|
template:
|
|
@@ -113,10 +144,13 @@
|
|
dest: '/etc/php/{{ php_version }}/apache2/conf.d/99-local-config.ini'
|
|
dest: '/etc/php/{{ php_version }}/apache2/conf.d/99-local-config.ini'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
notify:
|
|
notify:
|
|
- 'Reload apache2'
|
|
- 'Reload apache2'
|
|
when: with_modphp and ansible_lsb.major_release|int >= 9
|
|
when: with_modphp and ansible_lsb.major_release|int >= 9
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Create system checks directory /etc/phpsyscheck'
|
|
- name: 'Create system checks directory /etc/phpsyscheck'
|
|
file:
|
|
file:
|
|
@@ -124,7 +158,10 @@
|
|
state: 'directory'
|
|
state: 'directory'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0755
|
|
|
|
|
|
+ mode: '0755'
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install phpinfo system check'
|
|
- name: 'Install phpinfo system check'
|
|
template:
|
|
template:
|
|
@@ -132,19 +169,25 @@
|
|
dest: '/etc/phpsyscheck/index.php'
|
|
dest: '/etc/phpsyscheck/index.php'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
|
|
|
|
- name: 'Install PHP APC extension (Debian <= 8)'
|
|
- name: 'Install PHP APC extension (Debian <= 8)'
|
|
apt:
|
|
apt:
|
|
pkg: 'php-apc'
|
|
pkg: 'php-apc'
|
|
state: 'present'
|
|
state: 'present'
|
|
when: with_php_apc and ansible_lsb.major_release|int <= 8
|
|
when: with_php_apc and ansible_lsb.major_release|int <= 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install PHP APC extension (Debian >= 9)'
|
|
- name: 'Install PHP APC extension (Debian >= 9)'
|
|
apt:
|
|
apt:
|
|
pkg: 'php-apcu'
|
|
pkg: 'php-apcu'
|
|
state: 'present'
|
|
state: 'present'
|
|
when: with_php_apc and ansible_lsb.major_release|int >= 9
|
|
when: with_php_apc and ansible_lsb.major_release|int >= 9
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install php-apc system check'
|
|
- name: 'Install php-apc system check'
|
|
template:
|
|
template:
|
|
@@ -152,44 +195,65 @@
|
|
dest: '/etc/phpsyscheck/apc.php'
|
|
dest: '/etc/phpsyscheck/apc.php'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
when: with_php_apc
|
|
when: with_php_apc
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install MySQL extension for PHP - native driver (Debian 8)'
|
|
- name: 'Install MySQL extension for PHP - native driver (Debian 8)'
|
|
apt:
|
|
apt:
|
|
pkg: 'php5-mysqlnd'
|
|
pkg: 'php5-mysqlnd'
|
|
state: 'present'
|
|
state: 'present'
|
|
when: not with_php_mysql_legacy and ansible_lsb.major_release|int == 8
|
|
when: not with_php_mysql_legacy and ansible_lsb.major_release|int == 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install MySQL extension for PHP (old driver)'
|
|
- name: 'Install MySQL extension for PHP (old driver)'
|
|
apt:
|
|
apt:
|
|
pkg: 'php5-mysql'
|
|
pkg: 'php5-mysql'
|
|
state: 'present'
|
|
state: 'present'
|
|
when: with_php_mysql_legacy
|
|
when: with_php_mysql_legacy
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install PHPMyAdmin'
|
|
- name: 'Install PHPMyAdmin'
|
|
apt:
|
|
apt:
|
|
pkg: 'phpmyadmin'
|
|
pkg: 'phpmyadmin'
|
|
state: 'present'
|
|
state: 'present'
|
|
when: with_phpmyadmin
|
|
when: with_phpmyadmin
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install PHPPgAdmin'
|
|
- name: 'Install PHPPgAdmin'
|
|
apt:
|
|
apt:
|
|
pkg: 'phppgadmin'
|
|
pkg: 'phppgadmin'
|
|
state: 'present'
|
|
state: 'present'
|
|
when: with_phppgadmin
|
|
when: with_phppgadmin
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install FPM for PHP 5 (Debian <= 8)'
|
|
- name: 'Install FPM for PHP 5 (Debian <= 8)'
|
|
apt:
|
|
apt:
|
|
pkg: 'php5-fpm'
|
|
pkg: 'php5-fpm'
|
|
state: 'present'
|
|
state: 'present'
|
|
when: with_fpm and ansible_lsb.major_release|int <= 8
|
|
when: with_fpm and ansible_lsb.major_release|int <= 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install FPM for PHP {{ php_version }} (Debian >= 9)'
|
|
- name: 'Install FPM for PHP {{ php_version }} (Debian >= 9)'
|
|
apt:
|
|
apt:
|
|
pkg: 'php{{ php_version }}-fpm'
|
|
pkg: 'php{{ php_version }}-fpm'
|
|
state: 'present'
|
|
state: 'present'
|
|
when: with_fpm and ansible_lsb.major_release|int >= 9
|
|
when: with_fpm and ansible_lsb.major_release|int >= 9
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Configure FPM for PHP 5 (Debian <= 8)'
|
|
- name: 'Configure FPM for PHP 5 (Debian <= 8)'
|
|
lineinfile:
|
|
lineinfile:
|
|
@@ -208,6 +272,9 @@
|
|
notify:
|
|
notify:
|
|
- 'Reload FPM for PHP 5'
|
|
- 'Reload FPM for PHP 5'
|
|
when: with_fpm and ansible_lsb.major_release|int <= 8
|
|
when: with_fpm and ansible_lsb.major_release|int <= 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Configure FPM for PHP {{ php_version }} (Debian >= 9)'
|
|
- name: 'Configure FPM for PHP {{ php_version }} (Debian >= 9)'
|
|
lineinfile:
|
|
lineinfile:
|
|
@@ -226,6 +293,9 @@
|
|
notify:
|
|
notify:
|
|
- 'Reload FPM for PHP'
|
|
- 'Reload FPM for PHP'
|
|
when: with_fpm and ansible_lsb.major_release|int >= 9
|
|
when: with_fpm and ansible_lsb.major_release|int >= 9
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install FPM pools configuration for PHP 5 (Debian <= 8)'
|
|
- name: 'Install FPM pools configuration for PHP 5 (Debian <= 8)'
|
|
template:
|
|
template:
|
|
@@ -233,10 +303,13 @@
|
|
dest: '/etc/php5/fpm/pool.d/local-pool.cnf'
|
|
dest: '/etc/php5/fpm/pool.d/local-pool.cnf'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
notify:
|
|
notify:
|
|
- 'Reload FPM for PHP 5'
|
|
- 'Reload FPM for PHP 5'
|
|
when: with_fpm and ansible_lsb.major_release|int <= 8
|
|
when: with_fpm and ansible_lsb.major_release|int <= 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install FPM pools configuration for PHP {{ php_version }} (Debian > 9)'
|
|
- name: 'Install FPM pools configuration for PHP {{ php_version }} (Debian > 9)'
|
|
template:
|
|
template:
|
|
@@ -244,10 +317,13 @@
|
|
dest: '/etc/php/{{ php_version }}/fpm/pool.d/local-pool.cnf'
|
|
dest: '/etc/php/{{ php_version }}/fpm/pool.d/local-pool.cnf'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
notify:
|
|
notify:
|
|
- 'Reload FPM for PHP'
|
|
- 'Reload FPM for PHP'
|
|
when: with_fpm and ansible_lsb.major_release|int >= 9
|
|
when: with_fpm and ansible_lsb.major_release|int >= 9
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install local PHP configuration overrides for php5-fpm (Debian 8)'
|
|
- name: 'Install local PHP configuration overrides for php5-fpm (Debian 8)'
|
|
template:
|
|
template:
|
|
@@ -255,8 +331,11 @@
|
|
dest: '/etc/php5/fpm/conf.d/99-local-config.ini'
|
|
dest: '/etc/php5/fpm/conf.d/99-local-config.ini'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
when: with_fpm and ansible_lsb.major_release|int == 8
|
|
when: with_fpm and ansible_lsb.major_release|int == 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install local PHP configuration overrides for php{{ php_version }}-fpm (Debian >= 9)'
|
|
- name: 'Install local PHP configuration overrides for php{{ php_version }}-fpm (Debian >= 9)'
|
|
template:
|
|
template:
|
|
@@ -264,8 +343,11 @@
|
|
dest: '/etc/php/{{ php_version }}/fpm/conf.d/99-local-config.ini'
|
|
dest: '/etc/php/{{ php_version }}/fpm/conf.d/99-local-config.ini'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
when: with_fpm and ansible_lsb.major_release|int >= 9
|
|
when: with_fpm and ansible_lsb.major_release|int >= 9
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install Nginx config files for PHP FPM (fpm servers pool)'
|
|
- name: 'Install Nginx config files for PHP FPM (fpm servers pool)'
|
|
template:
|
|
template:
|
|
@@ -273,10 +355,13 @@
|
|
dest: '/etc/nginx/conf.d/fpm-pool.conf'
|
|
dest: '/etc/nginx/conf.d/fpm-pool.conf'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
notify:
|
|
notify:
|
|
- 'Reload nginx'
|
|
- 'Reload nginx'
|
|
when: with_fpm and with_nginx
|
|
when: with_fpm and with_nginx
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Install Nginx config files for PHP FPM (fpm fastcgi config)'
|
|
- name: 'Install Nginx config files for PHP FPM (fpm fastcgi config)'
|
|
template:
|
|
template:
|
|
@@ -284,21 +369,30 @@
|
|
dest: '/etc/nginx/fastcgi_pass_fpm'
|
|
dest: '/etc/nginx/fastcgi_pass_fpm'
|
|
owner: 'root'
|
|
owner: 'root'
|
|
group: 'root'
|
|
group: 'root'
|
|
- mode: 0644
|
|
|
|
|
|
+ mode: '0644'
|
|
notify:
|
|
notify:
|
|
- 'Reload nginx'
|
|
- 'Reload nginx'
|
|
when: with_fpm and with_nginx
|
|
when: with_fpm and with_nginx
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Ensure FPM for PHP 5 is running (Debian <= 8)'
|
|
- name: 'Ensure FPM for PHP 5 is running (Debian <= 8)'
|
|
service:
|
|
service:
|
|
name: 'php5-fpm'
|
|
name: 'php5-fpm'
|
|
state: 'started'
|
|
state: 'started'
|
|
when: with_fpm and ansible_lsb.major_release|int <= 8
|
|
when: with_fpm and ansible_lsb.major_release|int <= 8
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
- name: 'Ensure FPM for PHP {{ php_version }} is running (Debian >= 9)'
|
|
- name: 'Ensure FPM for PHP {{ php_version }} is running (Debian >= 9)'
|
|
service:
|
|
service:
|
|
name: 'php{{ php_version }}-fpm'
|
|
name: 'php{{ php_version }}-fpm'
|
|
state: 'started'
|
|
state: 'started'
|
|
when: with_fpm and ansible_lsb.major_release|int >= 9
|
|
when: with_fpm and ansible_lsb.major_release|int >= 9
|
|
|
|
+ tags:
|
|
|
|
+ - 'web'
|
|
|
|
+ - 'php'
|
|
|
|
|
|
-# vim: ft=ansible
|
|
|
|
|
|
+# vim: ft=yaml.ansible
|