ansible-php/tasks/fpm.yml

30 lines
867 B
YAML
Raw Permalink Normal View History

2015-07-23 15:40:33 +07:00
---
2018-03-19 03:29:47 +07:00
- name: APT | Install PHP-FPM for Debian based systems
2018-03-18 23:28:57 +07:00
apt:
pkg: "{{ php_fpm_service }}"
2018-03-19 03:29:47 +07:00
state: "{{ 'present' if php_install_fpm else 'absent' }}"
when: ansible_os_family == 'Debian'
- name: SERVICE | Enable service on FreeBSD
service:
name: "{{ php_fpm_service }}"
enabled: "{{ 'yes' if php_install_fpm else 'no' }}"
when: ansible_os_family == 'FreeBSD'
2015-07-23 15:40:33 +07:00
- name: LINEINFILE | PHP configuration
2017-11-10 18:19:39 +07:00
lineinfile:
2018-03-18 23:28:57 +07:00
dest: '{{ php_cli_ini }}'
2017-11-10 18:19:39 +07:00
regexp: '^;?{{ item.key }}'
line: '{{ item.key }} = {{ item.value }}'
2018-03-19 03:29:47 +07:00
create: yes
2017-11-10 18:19:39 +07:00
with_dict: "{{ php_ini | combine(php_ini_fpm) }}"
2015-07-23 15:40:33 +07:00
notify: restart php-fpm
2015-07-23 22:10:15 +07:00
- name: TEMPLATE | Deploy pool configuration
2018-03-18 23:28:57 +07:00
template:
src: etc/__php__/fpm/pool.d/pool.conf.j2
dest: '{{ php_fpm_pool_dir }}/{{ item.pool_name }}.conf'
2016-03-06 21:36:50 +07:00
with_items: "{{ php_fpm_poold }}"
2015-07-23 22:10:15 +07:00
notify: restart php-fpm