- name: tools
run_list:
- recipe[tools::default]
+ - name: trac
+ run_list:
+ - recipe[trac::default]
- name: web-backend
run_list:
- recipe[web::backend]
- name: "Test Kitchen (tools)"
script:
- bundle exec kitchen test tools-ubuntu-1804
+ - name: "Test Kitchen (trac)"
+ script:
+ - bundle exec kitchen test trac-ubuntu-1804
- name: "Test Kitchen (web::backend)"
script:
- bundle exec kitchen test web-backend-ubuntu-1804
--- /dev/null
+default[:accounts][:users][:trac][:status] = :role
version "1.0.0"
supports "ubuntu"
+depends "accounts"
depends "apache"
# limitations under the License.
#
+include_recipe "accounts"
include_recipe "apache"
package %w[
trac
- trac-git
ruby
]
site_name = "trac.openstreetmap.org"
site_directory = "/srv/#{site_name}"
+directory "/var/lib/trac" do
+ owner "trac"
+ group "trac"
+ mode 0o755
+end
+
+execute "trac-initenv-#{site_name}" do
+ command "trac-admin /var/lib/trac initenv #{site_name} sqlite:db/trac.db"
+ user "trac"
+ group "trac"
+ not_if { ::File.exist?("/var/lib/trac/VERSION") }
+end
+
template "/var/lib/trac/conf/trac.ini" do
source "trac.ini.erb"
owner "trac"
apache_module "wsgi"
+apache_module "authnz_external" do
+ package "libapache2-mod-authnz-external"
+end
+
ssl_certificate "trac.openstreetmap.org" do
domains ["trac.openstreetmap.org", "trac.osm.org"]
notifies :reload, "service[apache2]"
name "trac"
description "Role applied to all trac servers"
-default_attributes(
- :accounts => {
- :users => {
- :trac => { :status => :role }
- }
- }
-)
run_list(
"recipe[trac]"
)
--- /dev/null
+{
+ "id": "trac",
+ "uid": "509",
+ "comment": "trac.openstreetmap.org",
+ "home": "/var/lib/trac",
+ "manage_home": false
+}
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("apache2") do
+ it { should be_installed }
+end
+
+describe service("apache2") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+describe port(80) do
+ it { should be_listening.with("tcp") }
+end
+
+describe port(443) do
+ it { should be_listening.with("tcp") }
+end