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 include_recipe "accounts"
22 users = data_bag_item("supybot", "users")
23 passwords = data_bag_item("supybot", "passwords")
28 directory "/etc/supybot" do
34 template "/etc/supybot/supybot.conf" do
35 source "supybot.conf.erb"
39 variables :passwords => passwords
42 template "/etc/supybot/channels.conf" do
43 source "channels.conf.erb"
49 template "/etc/supybot/git.conf" do
56 template "/etc/supybot/ignores.conf" do
57 source "ignores.conf.erb"
63 template "/etc/supybot/userdata.conf" do
64 source "userdata.conf.erb"
70 template "/etc/supybot/users.conf" do
71 source "users.conf.erb"
75 variables :passwords => users
78 directory "/var/lib/supybot" do
84 directory "/var/lib/supybot/data" do
90 directory "/var/lib/supybot/backup" do
96 directory "/var/lib/supybot/git" do
102 directory "/var/log/supybot" do
108 directory "/usr/local/lib/supybot" do
114 directory "/usr/local/lib/supybot/plugins" do
120 git "/usr/local/lib/supybot/plugins/Git" do
122 repository "https://github.com/openstreetmap/supybot-git"
129 systemd_service "supybot" do
130 description "OpenStreetMap IRC Robot"
131 after "network.target"
133 exec_start "/usr/bin/supybot /etc/supybot/supybot.conf"
138 no_new_privileges true
143 action [:enable, :start]
144 subscribes :restart, "template[/etc/supybot/supybot.conf]"
145 subscribes :restart, "template[/etc/supybot/channels.conf]"
146 subscribes :restart, "template[/etc/supybot/git.conf]"
147 subscribes :restart, "template[/etc/supybot/ignores.conf]"
148 subscribes :restart, "template[/etc/supybot/userdata.conf]"
149 subscribes :restart, "template[/etc/supybot/users.conf]"
150 subscribes :restart, "git[/usr/local/lib/supybot/plugins/Git]"
151 subscribes :restart, "systemd_service[supybot]"