From 6867e2443863a78d61bcb41d4380ee79ed263bfc Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Wed, 22 Feb 2017 15:30:07 -0500 Subject: [PATCH] Reload nginx instead of restart We don't need to restart nginx - we can instead just reload the service. Additionally, as more services move to use nginx frontend, it would be bad to restart all NGinx services at the same time. For now we need to investigate the impact of reloads in UWsgi before moving over to a "reload" on UWsgi. Change-Id: I60e370e784a1ff3a0f5bf8551be804bf05d8bb43 --- handlers/main.yml | 4 ++-- tasks/nova_placement_nginx.yml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 4573b4f6..b239e813 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -70,10 +70,10 @@ - "{{ nova_services['nova-compute']['group'] in group_names }}" - "{{ nova_services['nova-compute']['condition'] | default(true) }}" -- name: Restart Nginx +- name: Reload Nginx systemd: name: nginx - state: restarted + state: reloaded register: nova_nginx_restart until: nova_nginx_restart | success retries: 5 diff --git a/tasks/nova_placement_nginx.yml b/tasks/nova_placement_nginx.yml index 1fa88589..3b18c8ef 100644 --- a/tasks/nova_placement_nginx.yml +++ b/tasks/nova_placement_nginx.yml @@ -19,7 +19,7 @@ groups: nova append: yes notify: - - Restart Nginx + - Reload Nginx tags: - nova-install @@ -28,7 +28,7 @@ path: /etc/nginx/sites-enabled/default state: absent notify: - - Restart Nginx + - Reload Nginx - name: Configure custom nginx log format lineinfile: @@ -36,7 +36,7 @@ dest: "/etc/nginx/nginx.conf" line: "log_format custom '{{ nova_placement_nginx_access_log_format_combined }} {{ nova_placement_nginx_access_log_format_extras }}';" notify: - - Restart Nginx + - Reload Nginx # Configure app - name: Configure virtual hosts @@ -44,7 +44,7 @@ src: nova-placement-nginx.conf.j2 dest: "/etc/nginx/{{ nova_nginx_conf_path }}/nova_placement_api.conf" notify: - - Restart Nginx + - Reload Nginx - name: Link to enable virtual hosts file: @@ -53,4 +53,4 @@ state: link when: ansible_os_family == "Debian" notify: - - Restart Nginx + - Reload Nginx