Initial Chef repository

This commit is contained in:
Greg Karékinian
2015-07-21 19:45:23 +02:00
parent 7e5401fc71
commit ee4079fa85
1151 changed files with 185163 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#
# Cookbook Name:: sockethub
# Recipe:: default
#
# Copyright 2015, Kosmos
#
# All rights reserved - Do Not Redistribute
#
include_recipe 'kosmos-nodejs'
include_recipe 'kosmos-redis'
application "sockethub" do
path "/srv/sockethub"
owner "www-data"
group "www-data"
action :deploy
repository 'https://github.com/sockethub/sockethub.git'
revision 'experimental_v1_0'
nodejs do
entry_point '/srv/sockethub/current/bin/sockethub'
# Use our own systemd service that depends on redis-server
template 'nodejs.systemd.service.erb'
environment 'DEBUG' => '*',
'PORT' => node['sockethub']['port']
end
end

View File

@@ -0,0 +1,50 @@
#
# Cookbook Name:: sockethub
# Recipe:: proxy
#
# Copyright 2015, Kosmos
#
# All rights reserved - Do Not Redistribute
#
firewall_rule 'sockethub' do
port node['sockethub']['external_port'].to_i
protocol :tcp
action :allow
end
include_recipe 'kosmos-nginx'
data_bag_item = Chef::EncryptedDataBagItem.load('certificates', 'wildcard_kosmos_org')
ssl_cert_path = "/etc/ssl/private/wildcard.kosmos.org.crt"
file ssl_cert_path do
content data_bag_item['ssl_cert']
mode 0600
owner 'www-data'
sensitive true
end
ssl_key_path = "/etc/ssl/private/wildcard.kosmos.org.key"
file ssl_key_path do
content data_bag_item['ssl_key']
mode 0600
owner 'www-data'
sensitive true
end
template "#{node['nginx']['dir']}/sites-available/sockethub" do
source 'nginx_conf_sockethub.erb'
owner 'www-data'
mode 0640
variables sockethub_port: node['sockethub']['port'],
sockethub_external_port: node['sockethub']['external_port'],
server_name: 'sockethub.kosmos.org',
ssl_cert: ssl_cert_path,
ssl_key: ssl_key_path
notifies :reload, 'service[nginx]', :delayed
end
nginx_site 'sockethub' do
enable true
end