ansible-role-phpmyadmin/tasks/phpfpm.yml
2024-01-04 08:19:42 +01:00

50 lines
1.3 KiB
YAML

---
- name: "PHPFPM | Create user"
ansible.builtin.user:
name: "{{ phpmyadmin_user }}"
shell: /bin/false
create_home: false
password_lock: true
- name: "PHPFPM | Add www-data to user group"
ansible.builtin.user:
name: www-data
groups: "{{ phpmyadmin_user }}"
append: true
- name: "PHPFPM | Create log file"
ansible.builtin.file:
path: "{{ php_fpm_log_dir }}/{{ phpmyadmin_user }}.log"
state: touch
mode: "0644"
owner: "{{ phpmyadmin_user }}"
group: "{{ phpmyadmin_user }}"
access_time: preserve
modification_time: preserve
- name: "PHPFPM | Create pool"
ansible.builtin.template:
src: fpmpool.j2
dest: "{{ php_fpm_pool_dir }}/{{ phpmyadmin_user }}.cfg"
mode: "0644"
notify:
- Stop php-fpm-socket
- Stop php-fpm-service
- Start php-fpm-socket
- name: "PHPFPM | Create override directory"
ansible.builtin.file:
path: "/etc/systemd/system/php-fpm@{{ phpmyadmin_user }}.service.d"
state: directory
mode: "0755"
- name: "PHPFPM | Copy override file"
ansible.builtin.template:
src: override.conf.j2
dest: "/etc/systemd/system/php-fpm@{{ phpmyadmin_user }}.service.d/override.conf"
mode: "0644"
notify:
- Stop php-fpm-socket
- Stop php-fpm-service
- Start php-fpm-socket
- Start php-fpm-service