30 lines
		
	
	
		
			693 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			693 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| #
 | |
| # Cookbook:: kosmos_website
 | |
| # Recipe:: default
 | |
| #
 | |
| 
 | |
| include_recipe "git"
 | |
| 
 | |
| domain = node["kosmos_website"]["domain"]
 | |
| 
 | |
| tls_cert_for domain do
 | |
|   auth "gandi_dns"
 | |
|   action :create
 | |
| end
 | |
| 
 | |
| git "/var/www/#{domain}" do
 | |
|   user node["openresty"]["user"]
 | |
|   group node["openresty"]["group"]
 | |
|   repository node["kosmos_website"]["repo"]
 | |
|   revision node["kosmos_website"]["revision"]
 | |
|   action :sync
 | |
| end
 | |
| 
 | |
| openresty_site domain do
 | |
|   template "nginx_conf_website.erb"
 | |
|   variables domain: domain,
 | |
|             accounts_url: node.default["kosmos_website"]["accounts_url"],
 | |
|             ssl_cert: "/etc/letsencrypt/live/#{domain}/fullchain.pem",
 | |
|             ssl_key:  "/etc/letsencrypt/live/#{domain}/privkey.pem"
 | |
| end
 |