From 7341b2ec643f96267971edf28d34d46ee4189190 Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Tue, 7 Jul 2020 10:44:13 +0200 Subject: [PATCH] Flush handlers before running `nginx -T` and setting up logrotate (#279) --- tasks/conf/logrotate.yml | 3 --- tasks/main.yml | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tasks/conf/logrotate.yml b/tasks/conf/logrotate.yml index 80db613..ffff9ea 100644 --- a/tasks/conf/logrotate.yml +++ b/tasks/conf/logrotate.yml @@ -33,9 +33,6 @@ dest: "/etc/logrotate.d/nginx" register: nginx_logrotate_result -- name: "(Config: All OSs) Ensure NGINX is Running" - meta: flush_handlers - - name: "(Config: All OSs) Run Logrotate" command: logrotate -f /etc/logrotate.d/nginx changed_when: nginx_logrotate_result.changed diff --git a/tasks/main.yml b/tasks/main.yml index 0f855c7..c1982ee 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -53,16 +53,23 @@ when: true in nginx_modules.values() tags: nginx_install_modules - - include_tasks: "{{ role_path }}/tasks/conf/debug-output.yml" - when: nginx_debug_output | bool - tags: nginx_debug_output - - include_tasks: "{{ role_path }}/tasks/plus/delete-license.yml" when: - nginx_type == "plus" - nginx_delete_license tags: nginx_delete_license + - name: "(Config: All OSs) Ensure NGINX is Running" + meta: flush_handlers + + - include_tasks: "{{ role_path }}/tasks/conf/debug-output.yml" + when: nginx_debug_output | bool + tags: nginx_debug_output + + - include_tasks: "{{ role_path }}/tasks/conf/logrotate.yml" + when: nginx_logrotate_conf_enable | bool + tags: nginx_logrotate_config + when: nginx_enable | bool - include_tasks: "{{ role_path }}/tasks/amplify/install-amplify.yml" @@ -75,7 +82,3 @@ - include_tasks: "{{ role_path }}/tasks/unit/install-unit.yml" when: nginx_unit_enable | bool tags: nginx_install_unit - -- include_tasks: "{{ role_path }}/tasks/conf/logrotate.yml" - when: nginx_logrotate_conf_enable | bool - tags: nginx_logrotate_config