Add a cookbook to set up an instance of botka on our XMPP server
This commit is contained in:
61
site-cookbooks/5apps-hubot/recipes/xmpp_botka.rb
Normal file
61
site-cookbooks/5apps-hubot/recipes/xmpp_botka.rb
Normal file
@@ -0,0 +1,61 @@
|
||||
#
|
||||
# Cookbook Name:: 5apps-hubot
|
||||
# Recipe:: default
|
||||
#
|
||||
# Copyright 2016, Kosmos
|
||||
#
|
||||
# All rights reserved - Do Not Redistribute
|
||||
#
|
||||
|
||||
firewall_rule 'hubot_express_botka_xmpp' do
|
||||
port 8082
|
||||
protocol :tcp
|
||||
command :allow
|
||||
end
|
||||
|
||||
botka_xmpp_data_bag_item = Chef::EncryptedDataBagItem.load('credentials', '5apps_botka_xmpp')
|
||||
|
||||
application "botka_xmpp" do
|
||||
path "/srv/botka_xmpp"
|
||||
owner "hubot"
|
||||
group "hubot"
|
||||
|
||||
action :deploy
|
||||
|
||||
before_restart do
|
||||
file "#{new_resource.release_path}/external-scripts.json" do
|
||||
mode "0640"
|
||||
owner "hubot"
|
||||
group "hubot"
|
||||
content [
|
||||
"hubot-help",
|
||||
"hubot-remotestorage-logger"
|
||||
].to_json
|
||||
end
|
||||
end
|
||||
|
||||
repository "git@gitlab.com:5apps/schlupp.git"
|
||||
revision "master"
|
||||
deploy_key botka_xmpp_data_bag_item['deploy_key']
|
||||
|
||||
nodejs do
|
||||
entry_point "/srv/botka_xmpp/current/bin/hubot -a xmpp --name botka"
|
||||
# Use our own systemd service that depends on redis-server
|
||||
template "nodejs.systemd.service.erb"
|
||||
environment "HUBOT_XMPP_USERNAME" => "botka@5apps.com",
|
||||
"HUBOT_XMPP_PASSWORD" => botka_xmpp_data_bag_item['password'],
|
||||
"HUBOT_XMPP_ROOMS" => "watercooler@muc.5apps.com,5ops@muc.5apps.com",
|
||||
"HUBOT_XMPP_HOST" => "xmpp.5apps.com",
|
||||
"HUBOT_RSS_PRINTSUMMARY" => "false",
|
||||
"EXPRESS_PORT" => "8082",
|
||||
"HUBOT_RSS_HEADER" => "Update:",
|
||||
"HUBOT_AUTH_ADMIN" => "galfert,gregkare,basti",
|
||||
"HUBOT_IRC_USESSL" => "true",
|
||||
"REDIS_URL" => "redis://localhost:6379/5apps_botka_xmpp",
|
||||
"RS_LOGGER_USER" => "5apps@5apps.com",
|
||||
"RS_LOGGER_TOKEN" => botka_xmpp_data_bag_item['rs_logger_token'],
|
||||
"RS_LOGGER_SERVER_NAME" => "5apps",
|
||||
"RS_OPS_TOKEN" => botka_xmpp_data_bag_item['rs_ops_token'],
|
||||
"WEBHOOK_TOKEN" => botka_xmpp_data_bag_item['webhook_token']
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user