diff --git a/nginx/defaults/main.yml b/nginx/defaults/main.yml index 44231dad..229206eb 100644 --- a/nginx/defaults/main.yml +++ b/nginx/defaults/main.yml @@ -16,6 +16,9 @@ nginx_conf_snippets: - nginx-proxy-params.conf - nginx-server-ssl.conf +nginx_old_snippets: + - compression.conf + nginx_workers: 4 nginx_worker_connections: 1024 nginx_multi_accept: 'off' diff --git a/nginx/tasks/nginx-config.yml b/nginx/tasks/nginx-config.yml index 06ea36f5..60d82f22 100644 --- a/nginx/tasks/nginx-config.yml +++ b/nginx/tasks/nginx-config.yml @@ -15,5 +15,9 @@ template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf mode=444 notify: Reload nginx + - name: Remove the old configuration snippets + file: dest=/etc/nginx/conf.d/{{ item }} state=absent + with_items: '{{ nginx_old_snippets }}' + when: nginx_enabled tags: [ 'nginx', 'nginx_conf', 'nginx_virtualhost' ]