41 lines
1.1 KiB
YAML
Raw Permalink Normal View History

---
- name: Install relevant packages
ansible.builtin.apt:
cache_valid_time: 3600
update_cache: true
name:
- php{{ php.version }}-cli
- php{{ php.version }}-fpm
- php{{ php.version }}-mysql
- php{{ php.version }}-opcache
- php{{ php.version }}-mbstring
- php{{ php.version }}-xml
- php{{ php.version }}-gd
- php{{ php.version }}-curl
- php-json
state: present
become: true
- name: Disable default pool
ansible.builtin.command: mv /etc/php/{{ php.version }}/fpm/pool.d/www.conf /etc/php/{{ php.version }}/fpm/pool.d/www.conf.disabled
args:
creates: /etc/php/{{ php.version }}/fpm/pool.d/www.conf.disabled
notify: restart php-fpm
become: true
- name: Create socket
ansible.builtin.file:
path: /var/run/php/wordpress.sock
state: touch
owner: www-data
group: www-data
notify: restart php-fpm
become: true
- name: Copy php-fpm configuration
ansible.builtin.template:
src: wordpress.conf.j2
dest: "/etc/php/{{ php.version }}/fpm/pool.d/wordpress.conf"
notify: restart php-fpm
become: true