From 16ab9d18935a597b26c59923b282288463d7d478 Mon Sep 17 00:00:00 2001 From: Igor Rzegocki Date: Fri, 2 Sep 2016 11:42:28 +0200 Subject: [PATCH] fix: Switched from `nginx reload` to `nginx restart` after succesful deploy/undeploy Nginx needs to be restarted, otherwise it won't load some config changes (for example updated SSL certificates). Resolves #36 --- libraries/drivers_webserver_nginx.rb | 4 ++-- spec/unit/recipes/deploy_spec.rb | 2 +- spec/unit/recipes/undeploy_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/drivers_webserver_nginx.rb b/libraries/drivers_webserver_nginx.rb index fc87df0d..300c9b37 100644 --- a/libraries/drivers_webserver_nginx.rb +++ b/libraries/drivers_webserver_nginx.rb @@ -9,8 +9,8 @@ class Nginx < Drivers::Webserver::Base :log_dir, :proxy_read_timeout, :proxy_send_timeout, :send_timeout, :ssl_for_legacy_browsers, :extra_config, :extra_config_ssl ] - notifies :deploy, action: :reload, resource: 'service[nginx]', timer: :delayed - notifies :undeploy, action: :reload, resource: 'service[nginx]', timer: :delayed + notifies :deploy, action: :restart, resource: 'service[nginx]', timer: :delayed + notifies :undeploy, action: :restart, resource: 'service[nginx]', timer: :delayed def raw_out output = node['defaults']['webserver'].merge(node['nginx']).merge( diff --git a/spec/unit/recipes/deploy_spec.rb b/spec/unit/recipes/deploy_spec.rb index 5cea942d..2bcb4d3a 100644 --- a/spec/unit/recipes/deploy_spec.rb +++ b/spec/unit/recipes/deploy_spec.rb @@ -59,7 +59,7 @@ expect(chef_run).to run_execute('stop unicorn') expect(chef_run).to run_execute('start unicorn') - expect(deploy).to notify('service[nginx]').to(:reload).delayed + expect(deploy).to notify('service[nginx]').to(:restart).delayed expect(service).to do_nothing end diff --git a/spec/unit/recipes/undeploy_spec.rb b/spec/unit/recipes/undeploy_spec.rb index af541954..9820cbbf 100644 --- a/spec/unit/recipes/undeploy_spec.rb +++ b/spec/unit/recipes/undeploy_spec.rb @@ -29,7 +29,7 @@ expect(chef_run).to run_execute('stop unicorn') expect(chef_run).to run_execute('start unicorn') - expect(undeploy).to notify('service[nginx]').to(:reload).delayed + expect(undeploy).to notify('service[nginx]').to(:restart).delayed expect(service).to do_nothing end