ansible-collection-nextcloud/roles/php/tasks/config.yml
s3lph 81576dc751
Some checks failed
Ansible Lint / build (push) Successful in 1m7s
Ansible Galaxy / deploy (push) Failing after 1m47s
fix: ansible-lint
2024-04-14 19:56:19 +02:00

54 lines
1.2 KiB
YAML

---
- name: Configure php-fpm
ansible.builtin.template:
src: "etc/php/conf.d/99-nextcloud.ini.j2"
dest: "/etc/php/{{ php_version }}/{{ item }}/conf.d/99-nextcloud.ini"
owner: root
group: root
mode: "0644"
loop:
- fpm
- cli
notify:
- restart php-fpm
- name: Find enabled php-fpm apache2 config
ansible.builtin.find:
paths: ["/etc/apache2/conf-enabled/"]
patterns: ["php*-fpm.conf"]
register: php_register_conf_enabled
- name: Enable wanted and disable unwanted php-fpm apache2 config
ansible.builtin.file:
path: "{{ item.path }}"
state: |
{%- if item.path.endswith(wanted) -%}
link
{%- else -%}
absent
{%- endif -%}
src: "/etc/apache2/conf-available{{ wanted }}"
owner: root
group: root
mode: "0644"
vars:
wanted: "/php{{ php_version }}-fpm.conf"
loop: "{{ php_register_conf_enabled.files }}"
notify:
- restart apache2
- name: Enable apache2 modules
community.general.apache2_module:
name: "{{ item }}"
loop:
- proxy_fcgi
- setenvif
notify:
- restart apache2
- name: Start and enable php-fpm
ansible.builtin.service:
name: "php{{ php_version }}-fpm.service"
state: started
enabled: true