18 lines
		
	
	
		
			349 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			349 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
#
 | 
						|
# Cookbook:: kosmos_gitea
 | 
						|
# Recipe:: nginx_ssh
 | 
						|
#
 | 
						|
 | 
						|
begin
 | 
						|
  upstream_ip_address = search(:node, "role:gitea").first["knife_zero"]["host"]
 | 
						|
rescue
 | 
						|
  Chef::Log.warn('No server with "gitea" role. Stopping here.')
 | 
						|
  return
 | 
						|
end
 | 
						|
 | 
						|
openresty_stream "ssh" do
 | 
						|
  template "nginx_conf_ssh.erb"
 | 
						|
  variables upstream_host: upstream_ip_address
 | 
						|
  action :enable
 | 
						|
end
 |