From a248416a4d494117d19d41383753f6dbd7d77cf3 Mon Sep 17 00:00:00 2001 From: cmacrae Date: Tue, 22 Dec 2015 16:55:29 +0000 Subject: [PATCH] Ensuring all instances that notify 'restart nginx' also validate first --- tasks/main.yml | 4 +++- tasks/vhosts.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 7b4a917..bdc3f00 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -27,7 +27,9 @@ group: root mode: 0644 validate: 'nginx -t -c %s' - notify: restart nginx + notify: + - validate nginx configuration + - restart nginx - name: Ensure nginx is started and enabled to start at boot. service: name=nginx state=started enabled=yes diff --git a/tasks/vhosts.yml b/tasks/vhosts.yml index 9cee3d3..5a7bde8 100644 --- a/tasks/vhosts.yml +++ b/tasks/vhosts.yml @@ -4,7 +4,9 @@ path: "{{ nginx_default_vhost_path }}" state: absent when: nginx_remove_default_vhost - notify: restart nginx + notify: + - validate nginx configuration + - restart nginx - name: Add managed vhost config file (if any vhosts are configured). template: