webapp/nextcloud: use ini_file for php settings to not destror our zzz-evolinux-custom.ini

This commit is contained in:
Ludovic Poujol 2022-09-02 10:18:48 +02:00
parent 0ec14fa2eb
commit 4f0553c057
3 changed files with 29 additions and 50 deletions

View file

@ -1,20 +0,0 @@
; Put customized values here.
allow_url_fopen = On
disable_functions = exec,shell-exec,system,passthru,popen
disable_functions =
user_ini.filename = ".user.ini"
max_execution_time = 300
memory_limit = 512M
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=24
opcache.max_accelerated_files=60000
opcache.memory_consumption=512
opcache.save_comments=1
opcache.revalidate_freq=1
upload_max_filesize = 2G
post_max_size = 2G

View file

@ -1,4 +0,0 @@
; Put customized values here.
; default_charset = "ISO-8859-1"
allow_url_fopen = On
apc.enable_cli=1

View file

@ -1,30 +1,33 @@
---
- name: Enable apache2 php configuration
copy:
src: "zzz-apache2-evolinux-custom.ini"
dest: "/etc/php/7.4/apache2/conf.d/zzz-evolinux-custom.ini"
mode: "0644"
owner: root
group: root
force: yes
notify: reload apache
tags:
- nextcloud
- name: "Get PHP Version"
shell: 'php -v | grep "PHP [0-9]." | sed -E "s/PHP ([0-9]\.[0-9]).*/\1/g;"'
register: shell_php
check_mode: no
- name: Enable cli php configuration
copy:
src: "zzz-cli-evolinux-custom.ini"
dest: "/etc/php/7.4/cli/conf.d/zzz-evolinux-custom.ini"
mode: "0644"
owner: root
group: root
force: yes
notify: reload apache
tags:
- nextcloud
- name: "Set variables"
set_fact:
php_version: "{{ shell_php.stdout }}"
# - name: Generate ssl config
# shell:
# cmd: "/usr/local/sbin/vhost-domains {{ nextcloud_instance_name }} | /usr/local/sbin/make-csr {{ nextcloud_instance_name }}"
# creates: "/etc/nginx/ssl/{{ nextcloud_instance_name }}.conf"
- name: Apply specific PHP settings (apache)
ini_file:
path: "/etc/php/{{ php_version }}/apache2/conf.d/zzz-evolinux-custom.ini"
section: ''
option: "{{ item.option }}"
value: "{{ item.value }}"
notify: reload apache
with_items:
- {option: 'allow_url_fopen', value: 'On'}
- {option: 'disable_functions', value: ''}
- {option: 'max_execution_time', value: '300'}
- {option: 'memory_limit', value: '512M'}
- name: Apply specific PHP settings (cli)
ini_file:
path: "/etc/php/{{ php_version }}/cli/conf.d/zzz-evolinux-custom.ini"
section: ''
option: "{{ item.option }}"
value: "{{ item.value }}"
with_items:
- {option: 'allow_url_fopen', value: 'On'}
- {option: 'apc.enable_cli', value: 'On'}