add vhost template and tasks
This commit is contained in:
35
tasks/fpm_pools.yml
Normal file
35
tasks/fpm_pools.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
- name: php | create php log directories for pools
|
||||
file:
|
||||
path: "/var/log/php/{{ item.0.name }}/{{ item.1.version }}"
|
||||
state: directory
|
||||
owner: "{{ item.0.user | default('www-data') }}"
|
||||
group: "{{ item.0.group | default('www-data') }}"
|
||||
mode: '0755'
|
||||
recurse: yes
|
||||
loop: "{{ php_pools | subelements('php_versions') }}"
|
||||
when: php_pools is defined and php_pools | length > 0
|
||||
|
||||
- name: php | create php-fpm pool configurations
|
||||
template:
|
||||
src: pool.conf.j2
|
||||
dest: "/etc/php/{{ item.1.version }}/fpm/pool.d/{{ item.0.name }}.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
backup: yes
|
||||
loop: "{{ php_pools | subelements('php_versions') }}"
|
||||
when: php_pools is defined and php_pools | length > 0
|
||||
notify:
|
||||
- restart php-fpm services
|
||||
|
||||
- name: php | remove default www pool if requested
|
||||
file:
|
||||
path: "/etc/php/{{ item.version }}/fpm/pool.d/www.conf"
|
||||
state: absent
|
||||
loop: "{{ php_versions }}"
|
||||
when:
|
||||
- php_remove_default_pool is defined
|
||||
- php_remove_default_pool | bool
|
||||
notify:
|
||||
- restart php-fpm services
|
||||
@@ -4,3 +4,6 @@
|
||||
|
||||
- name: php | installation
|
||||
include_tasks: install.yml
|
||||
|
||||
- name: php | create fpm pools
|
||||
include_tasks: fpm_pools.yml
|
||||
Reference in New Issue
Block a user