5 # Copyright:: 2013, OpenStreetMap Foundation
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # https://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
20 users = data_bag_item("supybot", "users")
21 passwords = data_bag_item("supybot", "passwords")
26 directory "/etc/supybot" do
32 template "/etc/supybot/supybot.conf" do
33 source "supybot.conf.erb"
37 variables :passwords => passwords
40 template "/etc/supybot/channels.conf" do
41 source "channels.conf.erb"
47 template "/etc/supybot/git.conf" do
54 template "/etc/supybot/ignores.conf" do
55 source "ignores.conf.erb"
61 template "/etc/supybot/userdata.conf" do
62 source "userdata.conf.erb"
68 template "/etc/supybot/users.conf" do
69 source "users.conf.erb"
73 variables :passwords => users
76 directory "/var/lib/supybot" do
82 directory "/var/lib/supybot/data" do
88 directory "/var/lib/supybot/backup" do
94 directory "/var/lib/supybot/git" do
100 directory "/var/log/supybot" do
106 directory "/usr/local/lib/supybot" do
112 directory "/usr/local/lib/supybot/plugins" do
118 git "/usr/local/lib/supybot/plugins/Git" do
120 repository "git://github.com/openstreetmap/supybot-git"
126 systemd_service "supybot" do
127 description "OpenStreetMap IRC Robot"
128 after "network.target"
130 exec_start "/usr/bin/supybot /etc/supybot/supybot.conf"
135 no_new_privileges true
140 action [:enable, :start]
141 subscribes :restart, "template[/etc/supybot/supybot.conf]"
142 subscribes :restart, "template[/etc/supybot/channels.conf]"
143 subscribes :restart, "template[/etc/supybot/git.conf]"
144 subscribes :restart, "template[/etc/supybot/ignores.conf]"
145 subscribes :restart, "template[/etc/supybot/userdata.conf]"
146 subscribes :restart, "template[/etc/supybot/users.conf]"
147 subscribes :restart, "git[/usr/local/lib/supybot/plugins/Git]"
148 subscribes :restart, "systemd_service[supybot]"