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 @@ ...@@ -9,10 +9,6 @@
repo: "deb http://download.proxmox.com/debian/ceph-{{ ceph_proxmox_version }} {{ ansible_distribution_release }} main" repo: "deb http://download.proxmox.com/debian/ceph-{{ ceph_proxmox_version }} {{ ansible_distribution_release }} main"
filename: proxmox-ceph filename: proxmox-ceph
state: present state: present
notify: update apt cache
- name: Trigger APT handler
meta: flush_handlers
- name: Installation des plugins Telegraf - name: Installation des plugins Telegraf
import_role: import_role:
......
--- ---
- name: update apt cache
apt:
update_cache: true
- name: restart ssh - name: restart ssh
service: service:
name: ssh name: ssh
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import_role: import_role:
name: php_fpm name: php_fpm
vars: vars:
php_version: "7.4"
# Dokuwiki handles php session name by itself # Dokuwiki handles php session name by itself
php_fpm_session_name: "" php_fpm_session_name: ""
tags: ['php_fpm'] tags: ['php_fpm']
......
php_modules:
- php-curl
- php-gd
- php-xml
- php-mbstring
- php-zip
- php-apcu
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
import_role: import_role:
name: php_fpm name: php_fpm
vars: vars:
php_extra_modules:
- yaml
- sqlite3
# Grav handles php session name by itself # Grav handles php session name by itself
php_fpm_session_name: "" php_fpm_session_name: ""
tags: ['php_fpm'] 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 ...@@ -17,8 +17,6 @@ nextcloud_src_archive: "{{ nextcloud_src_dir }}/{{ nextcloud_install_url | basen
nextcloud_data_dir: "{{ web_app_dist_dir }}/data" nextcloud_data_dir: "{{ web_app_dist_dir }}/data"
nextcloud_import_file: "{{ web_app_dist_dir }}/config/import.json" nextcloud_import_file: "{{ web_app_dist_dir }}/config/import.json"
nextcloud_php_version: ""
nextcloud_postgres_install_enabled: true nextcloud_postgres_install_enabled: true
nextcloud_database_driver: pgsql nextcloud_database_driver: pgsql
nextcloud_database_name: nextcloud nextcloud_database_name: nextcloud
......
...@@ -8,8 +8,18 @@ ...@@ -8,8 +8,18 @@
import_role: import_role:
name: php_fpm name: php_fpm
vars: vars:
php_version: "{{ nextcloud_php_version }}" php_version: "8.0"
php_modules: "{{ nextcloud_php_modules }}" php_extra_modules:
- bcmath
- bz2
- fileinfo
- gmp
- imagick
- intl
- json
- pgsql
- redis
tags: ['php_fpm'] tags: ['php_fpm']
- name: Installation l'application web - name: Installation l'application web
......
...@@ -6,20 +6,3 @@ postgres_packages: ...@@ -6,20 +6,3 @@ postgres_packages:
- libpq-dev - libpq-dev
- python3-psycopg2 - python3-psycopg2
- acl - 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_config_dir: "/etc/php/{{ php_version }}"
php_modules: [] php_extra_modules: []
php_fpm_config_dir: "{{ php_config_dir }}/fpm" php_fpm_config_dir: "{{ php_config_dir }}/fpm"
php_fpm_pool_dir: "{{ php_fpm_config_dir }}/pool.d" 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: package:
name: "{{ php_packages + php_modules | map('regex_replace', '$', php_version) | list }}" name:
- "{{ php_executable }}"
- "{{ php_fpm_executable }}"
state: present state: present
- name: Installation de imagemagick - name: Installation des modules PHP par défaut
package: package:
name: imagemagick name: "{{ php_module }}"
state: present 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 - name: Installation des modules PHP additionnels
when: php_version == "" package:
block: name: "{{ php_module }}"
- name: Récupération de la dernière version de PHP state: present
# Regex: https://unix.stackexchange.com/questions/13466/can-grep-output-only-specified-groupings-that-match/13467#13467 loop: "{{ php_extra_modules }}"
shell: php -v | sed -n 's/^PHP \([[:digit:]]\.[[:digit:]]\).*/\1/p' loop_control:
changed_when: false loop_var: module_name
register: _php_version label: "{{ php_module }}"
vars:
php_module: "{{ php_executable }}-{{ module_name }}"
- name: Définition de la dernière version de PHP - name: Installation de imagemagick
set_fact: package:
php_version: "{{ _php_version.stdout }}" name: imagemagick
state: present
when: "'imagick' in php_extra_modules"
- name: Copie de la configuration OPCache - name: Copie de la configuration OPCache
template: template:
...@@ -33,7 +62,7 @@ ...@@ -33,7 +62,7 @@
- reload php-fpm - reload php-fpm
tags: ['php_config'] tags: ['php_config']
- name: Activation de php{{ php_version }}-fpm au démarrage - name: Activation de {{ php_fpm_executable }} au démarrage
service: service:
name: "{{ php_fpm_executable }}" name: "{{ php_fpm_executable }}"
state: started state: started
......
php_packages:
- php
- php-fpm
php_executable: "php{{ php_version }}" php_executable: "php{{ php_version }}"
php_fpm_executable: php{{ php_version }}-fpm php_fpm_executable: php{{ php_version }}-fpm
- name: update apt cache
apt:
update_cache: true
...@@ -17,10 +17,6 @@ ...@@ -17,10 +17,6 @@
repo: deb https://repos.influxdata.com/debian {{ ansible_distribution_release }} stable repo: deb https://repos.influxdata.com/debian {{ ansible_distribution_release }} stable
state: present state: present
filename: telegraf filename: telegraf
notify: update apt cache
- name: Trigger APT handler
meta: flush_handlers
- name: Installation de Telegraf - name: Installation de Telegraf
apt: 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