ansible-role-phpfpm/tasks/pools.yml

30 lines
689 B
YAML
Raw Normal View History

2018-08-07 20:53:28 +00:00
- name: check if pools log files exist
stat:
path: '{{ phpfpm_dir_log }}/{{ item[0].name }}.{{ item[1] }}'
with_nested:
- '{{ phpfpm_pools }}'
- ['slow.log', 'access.log', 'log']
register: st
tags: phpfpm
- name: create log files
file:
path: '{{ phpfpm_dir_log }}/{{ item.item[0].name }}.{{ item.item[1] }}'
owner: root
group: www-data
mode: 0640
state: touch
with_items: '{{ st.results }}'
when: not item.stat.exists
tags: phpfpm
- name: copy pools php-fpm configuration file
template:
src: pools.conf.j2
dest: '{{ phpfpm_dir }}/pools.conf'
owner: root
group: root
mode: 0644
notify: reload php-fpm
tags: phpfpm