Create a nginx_certbot_site resource to remove duplication

It creates a folder, the nginx vhost for certbot and HTTP redirects, and
also runs certbot and recreates the nginx vhost that includes the TLS
cert
This commit is contained in:
Greg Karékinian
2019-03-15 19:03:28 +01:00
parent b30dcab4da
commit 17f1b2a20a
23 changed files with 152 additions and 302 deletions

View File

@@ -108,10 +108,6 @@ action :enable do
end
if rpc_proxy_port
unless node.chef_environment == "development"
include_recipe "kosmos-parity::letsencrypt"
end
include_recipe "kosmos-nginx"
hostname = node['kosmos-parity']['hostname']
@@ -129,8 +125,12 @@ action :enable do
notifies :reload, 'service[nginx]', :delayed
end
nginx_site "#{parity_service}" do
nginx_site parity_service do
action :enable
end
nginx_certbot_site hostname do
site parity_service
end
end
end