diff --git a/tasks/main.yml b/tasks/main.yml index 8ed9e7f..bbef40c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,11 +4,11 @@ block: - name: Install the Ubuntu PHP PPA apt_repository: repo={{ php_ppa }} state=present update_cache=yes - when: php_from_ppa | bool + when: php_from_ppa - name: Remove the Ubuntu PHP PPA apt_repository: repo={{ php_ppa }} state=absent update_cache=yes - when: not php_from_ppa | bool + when: not php_from_ppa - name: Install the php-fpm package apt: pkg={{ php_fpm_packages }} state=present update_cache=yes cache_valid_time=3600 @@ -36,19 +36,19 @@ - name: Activate the memcache sessions support and redundancy if required action: configfile path={{ phpfpm_base_dir }}/conf.d/20-memcache.ini key={{ item.prop }} value='{{ item.value }}' - when: phpfpm_use_memcache_redundancy_sessions | bool + when: phpfpm_use_memcache_redundancy_sessions with_items: '{{ memcache_session }}' notify: Reload php-fpm - name: remove php-fpm default pool file: dest={{ phpfpm_base_dir }}/pool.d/www.conf state=absent - when: phpfpm_remove_default_pool | bool + when: phpfpm_remove_default_pool notify: Restart php-fpm - 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 + user: name={{ item.user }} comment="{{ item.user }}" home=/dev/null createhome=no shell=/usr/sbin/nologin with_items: '{{ phpfpm_pools }}' - when: phpfpm_create_users | bool + when: phpfpm_create_users notify: Restart php-fpm tags: [ 'php', 'fpm_pool' ] @@ -57,7 +57,7 @@ with_items: '{{ phpfpm_pools }}' when: - phpfpm_session_prefix is defined - - phpfpm_use_default_template | bool + - phpfpm_use_default_template tags: [ 'php', 'fpm_pool' ] - name: Create the directories where to store the log files @@ -75,7 +75,7 @@ - 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 | bool + when: phpfpm_use_default_template notify: Restart php-fpm tags: [ 'php', 'fpm_conf', 'fpm_pool', 'fpm_pool_conf' ] @@ -90,10 +90,10 @@ - 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 | bool + when: phpfpm_service_enabled - name: Ensure that the php-fpm service is stopped and disabled service: name=php{{ php_version }}-fpm state=stopped enabled=no - when: not phpfpm_service_enabled | bool + when: not phpfpm_service_enabled tags: php