diff --git a/roles/app/tasks/main.yml b/roles/app/tasks/main.yml index 0527ba26..4c3e027c 100644 --- a/roles/app/tasks/main.yml +++ b/roles/app/tasks/main.yml @@ -167,7 +167,6 @@ vars: { component_name: ssp, vhost_name: "{{ ssp_vhost_name }}" } when: "inventory_hostname in groups['dev']" - # Because nginx will restart with an invalid config without service detecting this, so we test the config first - name: Test nginx config command: /sbin/nginx -t @@ -175,7 +174,6 @@ changed_when: False failed_when: nginx_test.rc > 0 - - name: Start and enable nginx & php-fpm & smtp services service: name={{item}} state=started enabled=true with_items: diff --git a/roles/app/tasks/php72-vhost-symfony4-flex.yml b/roles/app/tasks/php72-vhost-symfony4-flex.yml index 76b08e73..73711ded 100644 --- a/roles/app/tasks/php72-vhost-symfony4-flex.yml +++ b/roles/app/tasks/php72-vhost-symfony4-flex.yml @@ -37,6 +37,13 @@ notify: - restart nginx +- name: Remove php5 php-fpm config if present + file: + path: '/etc/php-fpm.d/{{ vhost_name }}.conf' + state: absent + notify: + - restart php-fpm + # Put fpm config - name: Put php72-php-fpm config template: src='php72-fpm-pool.conf.j2' dest='/etc/opt/remi/php72/php-fpm.d/{{ vhost_name }}.conf' diff --git a/roles/app/tasks/php72-vhost-symfony4.yml b/roles/app/tasks/php72-vhost-symfony4.yml index 9af6762f..fdeec0a3 100644 --- a/roles/app/tasks/php72-vhost-symfony4.yml +++ b/roles/app/tasks/php72-vhost-symfony4.yml @@ -37,6 +37,12 @@ notify: - restart nginx +- name: Remove php5 php-fpm config if present + file: + path: '/etc/php-fpm.d/{{ vhost_name }}.conf' + state: absent + notify: + - restart php-fpm # Put fpm config - name: Put php72-php-fpm config