diff --git a/roles/php-fpm/tasks/Debian.yml b/roles/php-fpm/tasks/Debian.yml index 371c975..fbc3bb8 100644 --- a/roles/php-fpm/tasks/Debian.yml +++ b/roles/php-fpm/tasks/Debian.yml @@ -9,10 +9,11 @@ - php5-curl tags: php-fpm, packages +# only copy php-fpm config for vhosts that need WordPress or PHP - name: Copy php5-fpm pool config template: src=pool.conf.j2 dest=/etc/php5/fpm/pool.d/{{ item.domain_name }}.conf owner=root group=root mode=0644 with_items: "{{ nginx_vhosts }}" - when: nginx_vhosts is defined + when: (item.has_wordpress is defined and item.has_wordpress == True) or (item.needs_php is defined and item.needs_php == True) notify: restart php5-fpm tags: php-fpm diff --git a/roles/php-fpm/tasks/Ubuntu.yml b/roles/php-fpm/tasks/Ubuntu.yml index c2ec940..8e2cd14 100644 --- a/roles/php-fpm/tasks/Ubuntu.yml +++ b/roles/php-fpm/tasks/Ubuntu.yml @@ -12,10 +12,11 @@ - php7.0-xml tags: php-fpm, packages +# only copy php-fpm config for vhosts that need WordPress or PHP - name: Copy php-fpm pool config template: src=php7.0-pool.conf.j2 dest=/etc/php/7.0/fpm/pool.d/{{ item.domain_name }}.conf owner=root group=root mode=0644 with_items: "{{ nginx_vhosts }}" - when: nginx_vhosts is defined + when: (item.has_wordpress is defined and item.has_wordpress == True) or (item.needs_php is defined and item.needs_php == True) notify: restart php7.0-fpm tags: php-fpm