diff --git a/webapps/nextcloud/files/zzz-apache2-evolinux-custom.ini b/webapps/nextcloud/files/zzz-apache2-evolinux-custom.ini deleted file mode 100644 index 361628c2..00000000 --- a/webapps/nextcloud/files/zzz-apache2-evolinux-custom.ini +++ /dev/null @@ -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 \ No newline at end of file diff --git a/webapps/nextcloud/files/zzz-cli-evolinux-custom.ini b/webapps/nextcloud/files/zzz-cli-evolinux-custom.ini deleted file mode 100644 index f6785459..00000000 --- a/webapps/nextcloud/files/zzz-cli-evolinux-custom.ini +++ /dev/null @@ -1,4 +0,0 @@ -; Put customized values here. -; default_charset = "ISO-8859-1" -allow_url_fopen = On -apc.enable_cli=1 \ No newline at end of file diff --git a/webapps/nextcloud/tasks/apache-system.yml b/webapps/nextcloud/tasks/apache-system.yml index 38b85906..490d2f8d 100644 --- a/webapps/nextcloud/tasks/apache-system.yml +++ b/webapps/nextcloud/tasks/apache-system.yml @@ -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" \ No newline at end of file +- 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'}