Commit d9f5d0ca authored by HgO's avatar HgO
Browse files

Merge branch '63-php-8' into 'main'

Resolve "PHP 8"

Closes #63

See merge request Neutrinet/infra!70
parents a6021d78 5c6195ae
Pipeline #411 passed with stage
in 1 minute and 29 seconds
- name: update apt cache
apt:
update_cache: true
......@@ -9,10 +9,6 @@
repo: "deb http://download.proxmox.com/debian/ceph-{{ ceph_proxmox_version }} {{ ansible_distribution_release }} main"
filename: proxmox-ceph
state: present
notify: update apt cache
- name: Trigger APT handler
meta: flush_handlers
- name: Installation des plugins Telegraf
import_role:
......
---
- name: update apt cache
apt:
update_cache: true
- name: restart ssh
service:
name: ssh
......
......@@ -8,6 +8,7 @@
import_role:
name: php_fpm
vars:
php_version: "7.4"
# Dokuwiki handles php session name by itself
php_fpm_session_name: ""
tags: ['php_fpm']
......
php_modules:
- php-curl
- php-gd
- php-xml
- php-mbstring
- php-zip
- php-apcu
......@@ -8,6 +8,9 @@
import_role:
name: php_fpm
vars:
php_extra_modules:
- yaml
- sqlite3
# Grav handles php session name by itself
php_fpm_session_name: ""
tags: ['php_fpm']
......
php_modules:
- php-curl
- php-gd
- php-xml
- php-mbstring
- php-zip
- php-apcu
- php-yaml
- php-sqlite3
......@@ -17,8 +17,6 @@ nextcloud_src_archive: "{{ nextcloud_src_dir }}/{{ nextcloud_install_url | basen
nextcloud_data_dir: "{{ web_app_dist_dir }}/data"
nextcloud_import_file: "{{ web_app_dist_dir }}/config/import.json"
nextcloud_php_version: ""
nextcloud_postgres_install_enabled: true
nextcloud_database_driver: pgsql
nextcloud_database_name: nextcloud
......
......@@ -8,8 +8,18 @@
import_role:
name: php_fpm
vars:
php_version: "{{ nextcloud_php_version }}"
php_modules: "{{ nextcloud_php_modules }}"
php_version: "8.0"
php_extra_modules:
- bcmath
- bz2
- fileinfo
- gmp
- imagick
- intl
- json
- pgsql
- redis
tags: ['php_fpm']
- name: Installation l'application web
......
......@@ -6,20 +6,3 @@ postgres_packages:
- libpq-dev
- python3-psycopg2
- acl
nextcloud_php_modules:
- php-apcu
- php-curl
- php-bcmath
- php-bz2
- php-fileinfo
- php-gd
- php-gmp
- php-imagick
- php-intl
- php-json
- php-mbstring
- php-pgsql
- php-redis
- php-xml
- php-zip
php_version: ""
php_version: "8.0"
php_config_dir: "/etc/php/{{ php_version }}"
php_modules: []
php_extra_modules: []
php_fpm_config_dir: "{{ php_config_dir }}/fpm"
php_fpm_pool_dir: "{{ php_fpm_config_dir }}/pool.d"
......
---
- name: Prepare
hosts: all
become: true
pre_tasks:
- name: Mise à jour du cache APT
apt:
update_cache: true
cache_valid_time: 3600
tasks:
- name: Installation de GPG
package:
name: gpg
state: present
- name: Installation de PHP {{ php_version }} et de ses modules
- name: Ajout de la clé GPG de Sury dans APT
apt_key:
url: https://packages.sury.org/php/apt.gpg
state: present
- name: Ajout du dépôt Sury
apt_repository:
repo: deb https://packages.sury.org/php/ {{ ansible_distribution_release }} main
filename: sury-php
state: present
- name: Installation de PHP et PHP-FPM
package:
name: "{{ php_packages + php_modules | map('regex_replace', '$', php_version) | list }}"
name:
- "{{ php_executable }}"
- "{{ php_fpm_executable }}"
state: present
- name: Installation de imagemagick
- name: Installation des modules PHP par défaut
package:
name: imagemagick
name: "{{ php_module }}"
state: present
when: "'php-imagick' in php_modules"
loop:
- cli
- curl
- gd
- mbstring
- opcache
- xml
- zip
loop_control:
loop_var: module_name
label: "{{ php_module }}"
vars:
php_module: "{{ php_executable }}-{{ module_name }}"
- name: Récupération et définition de la dernière version de PHP
when: php_version == ""
block:
- name: Récupération de la dernière version de PHP
# Regex: https://unix.stackexchange.com/questions/13466/can-grep-output-only-specified-groupings-that-match/13467#13467
shell: php -v | sed -n 's/^PHP \([[:digit:]]\.[[:digit:]]\).*/\1/p'
changed_when: false
register: _php_version
- name: Installation des modules PHP additionnels
package:
name: "{{ php_module }}"
state: present
loop: "{{ php_extra_modules }}"
loop_control:
loop_var: module_name
label: "{{ php_module }}"
vars:
php_module: "{{ php_executable }}-{{ module_name }}"
- name: Définition de la dernière version de PHP
set_fact:
php_version: "{{ _php_version.stdout }}"
- name: Installation de imagemagick
package:
name: imagemagick
state: present
when: "'imagick' in php_extra_modules"
- name: Copie de la configuration OPCache
template:
......@@ -33,7 +62,7 @@
- reload php-fpm
tags: ['php_config']
- name: Activation de php{{ php_version }}-fpm au démarrage
- name: Activation de {{ php_fpm_executable }} au démarrage
service:
name: "{{ php_fpm_executable }}"
state: started
......
php_packages:
- php
- php-fpm
php_executable: "php{{ php_version }}"
php_fpm_executable: php{{ php_version }}-fpm
- name: update apt cache
apt:
update_cache: true
......@@ -17,10 +17,6 @@
repo: deb https://repos.influxdata.com/debian {{ ansible_distribution_release }} stable
state: present
filename: telegraf
notify: update apt cache
- name: Trigger APT handler
meta: flush_handlers
- name: Installation de Telegraf
apt:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment