Update/fix hubot URL, move variables to attributes

This commit is contained in:
Basti 2019-06-25 14:29:11 +02:00
parent 042014b1cb
commit fff5a044fe
No known key found for this signature in database
GPG Key ID: BE4634D632D39B67
2 changed files with 8 additions and 5 deletions

View File

@ -0,0 +1,3 @@
node.default["mediawiki"]["url"] = "https://wiki.kosmos.org/"
node.default["mediawiki"]["hubot_base_url"] = "http://barnard.kosmos.org:8080"
node.default["mediawiki"]["hubot_room"] = "#kosmos"

View File

@ -140,14 +140,14 @@ ark "MediawikiHubot" do
action :cherry_pick action :cherry_pick
end end
hal8000_freenode_data_bag_item = Chef::EncryptedDataBagItem.load('credentials', 'hal8000_freenode') hubot_credentials = Chef::EncryptedDataBagItem.load('credentials', 'hal8000_freenode')
webhook_token = hal8000_freenode_data_bag_item['webhook_token'] webhook_token = hubot_credentials['webhook_token']
template "#{node['mediawiki']['webdir']}/extensions/MediawikiHubot/DefaultConfig.php" do template "#{node['mediawiki']['webdir']}/extensions/MediawikiHubot/DefaultConfig.php" do
source "MediawikiHubot/DefaultConfig.php.erb" source "MediawikiHubot/DefaultConfig.php.erb"
variables webhook_url: "http://localhost:8080/incoming/#{webhook_token}", variables webhook_url: "#{node['mediawiki']['hubot_base_url']}/incoming/#{webhook_token}",
room_name: "#kosmos", room_name: node['mediawiki']['hubot_room'],
wiki_url: "https://wiki.kosmos.org/" wiki_url: node['mediawiki']['url']
end end
ruby_block "configuration" do ruby_block "configuration" do