|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
# php as a standalone service
|
|
|
|
|
- name: Install the Ubuntu PHP PPA
|
|
|
|
|
apt_repository: repo={{ php_ppa }} state=present update_cache=yes
|
|
|
|
|
when: php_from_ppa
|
|
|
|
|
when: php_from_ppa | bool
|
|
|
|
|
tags: [ 'php', 'php_ppa' ]
|
|
|
|
|
|
|
|
|
|
- name: Remove the Ubuntu PHP PPA
|
|
|
|
@ -37,28 +37,30 @@
|
|
|
|
|
|
|
|
|
|
- name: Activate the memcache sessions support and redundancy if needed
|
|
|
|
|
action: configfile path={{ phpfpm_base_dir }}/conf.d/20-memcache.ini key={{ item.prop }} value='{{ item.value }}'
|
|
|
|
|
when: phpfpm_use_memcache_redundancy_sessions
|
|
|
|
|
when: phpfpm_use_memcache_redundancy_sessions | bool
|
|
|
|
|
with_items: '{{ memcache_session }}'
|
|
|
|
|
notify: Reload php-fpm
|
|
|
|
|
tags: [ 'php', 'php_ini' ]
|
|
|
|
|
|
|
|
|
|
- name: remove php-fpm default pool
|
|
|
|
|
file: dest={{ phpfpm_base_dir }}/pool.d/www.conf state=absent
|
|
|
|
|
when: phpfpm_remove_default_pool
|
|
|
|
|
when: phpfpm_remove_default_pool | bool
|
|
|
|
|
notify: Restart php-fpm
|
|
|
|
|
tags: php
|
|
|
|
|
|
|
|
|
|
- name: Create the users under the php-fpm processes will run
|
|
|
|
|
user: name={{ item.user }} comment="{{ item.user }}" home=/dev/null createhome=no shell=/sbin/nologin
|
|
|
|
|
with_items: '{{ phpfpm_pools }}'
|
|
|
|
|
when: phpfpm_create_users
|
|
|
|
|
when: phpfpm_create_users | bool
|
|
|
|
|
notify: Restart php-fpm
|
|
|
|
|
tags: [ 'php', 'fpm_pool' ]
|
|
|
|
|
|
|
|
|
|
- name: Create the directories where to store the sessions files. One for each pool
|
|
|
|
|
file: dest={{ phpfpm_session_prefix }}/{{ item.pool_name }} owner={{ item.user }} group=root mode=0750 state=directory
|
|
|
|
|
with_items: '{{ phpfpm_pools }}'
|
|
|
|
|
when: phpfpm_use_default_template
|
|
|
|
|
when:
|
|
|
|
|
- phpfpm_session_prefix is defined
|
|
|
|
|
- phpfpm_use_default_template | bool
|
|
|
|
|
tags: [ 'php', 'fpm_pool' ]
|
|
|
|
|
|
|
|
|
|
- name: Create the directories where to store the log files
|
|
|
|
@ -77,13 +79,13 @@
|
|
|
|
|
- name: Install the php-fpm pools
|
|
|
|
|
template: src=php-fpm-pool.conf.j2 dest={{ phpfpm_base_dir }}/pool.d/{{ item.pool_name }}.conf owner=root group=root mode=0444
|
|
|
|
|
with_items: '{{ phpfpm_pools }}'
|
|
|
|
|
when: phpfpm_use_default_template
|
|
|
|
|
when: phpfpm_use_default_template | bool
|
|
|
|
|
notify: Restart php-fpm
|
|
|
|
|
tags: [ 'php', 'fpm_conf', 'fpm_pool', 'fpm_pool_conf' ]
|
|
|
|
|
|
|
|
|
|
- name: Ensure that the php-fpm service is started and enabled
|
|
|
|
|
service: name=php{{ php_version }}-fpm state=started enabled=yes
|
|
|
|
|
when: phpfpm_service_enabled
|
|
|
|
|
when: phpfpm_service_enabled | bool
|
|
|
|
|
tags: php
|
|
|
|
|
|
|
|
|
|
- name: Ensure that the php-fpm service is stopped and disabled
|
|
|
|
|