- name: tools
run_list:
- recipe[tools::default]
+ - name: web-backend
+ run_list:
+ - recipe[web::backend]
+ - name: web-cgimap
+ run_list:
+ - recipe[web::cgimap]
+ - name: web-frontend
+ run_list:
+ - recipe[web::frontend]
+ - name: web-rails
+ run_list:
+ - recipe[web::rails]
- name: "Test Kitchen (tools)"
script:
- bundle exec kitchen test tools-ubuntu-1804
+ - name: "Test Kitchen (web::backend)"
+ script:
+ - bundle exec kitchen test web-backend-ubuntu-1804
+ - name: "Test Kitchen (web::cgimap)"
+ script:
+ - bundle exec kitchen test web-cgimap-ubuntu-1804
+ - name: "Test Kitchen (web::frontend)"
+ script:
+ - bundle exec kitchen test web-frontend-ubuntu-1804
+ - name: "Test Kitchen (web::rails)"
+ script:
+ - bundle exec kitchen test web-rails-ubuntu-1804
-default_unless[:apt][:sources] = []
-
+default[:apt][:sources] = [ "openstreetmap" ]
default[:apt][:unattended_upgrades][:enable] = true
default[:apt][:unattended_upgrades][:remove_unused_dependencies] = true
default[:web][:base_directory] = "/srv/www.openstreetmap.org"
-default[:web][:pid_directory] = "/var/run/web"
+default[:web][:pid_directory] = "/run/web"
default[:web][:log_directory] = "/var/log/web"
default[:web][:primary_cluster] = false
+
+default[:accounts][:users][:rails][:status] = :role
depends "accounts"
depends "apache"
depends "apt"
+depends "chef"
depends "geoipupdate"
depends "git"
depends "memcached"
:path => "/store/rails"
}
+include_recipe "accounts"
include_recipe "nfs"
directory node[:web][:base_directory] do
# limitations under the License.
#
+include_recipe "apt"
include_recipe "tools"
include_recipe "web::base"
# limitations under the License.
#
-include_recipe "tools"
-include_recipe "web::base"
-
include_recipe "apache"
-include_recipe "passenger"
-include_recipe "geoipupdate"
+include_recipe "apt"
include_recipe "git"
+include_recipe "geoipupdate"
include_recipe "munin"
include_recipe "nodejs"
+include_recipe "passenger"
+include_recipe "tools"
+include_recipe "web::base"
web_passwords = data_bag_item("web", "passwords")
db_passwords = data_bag_item("db", "passwords")
imagemagick
nodejs
geoip-database
+ tzdata
]
package %w[
#
<Proxy balancer://backend>
ProxySet lbmethod=bybusyness
-<% node[:web][:backends].each do |backend| -%>
+<% Array(node[:web][:backends]).each do |backend| -%>
BalancerMember https://<%= backend %> disablereuse=on
<% end -%>
</Proxy>
:jburgess => { :status => :administrator }
}
},
- :apt => {
- :sources => ["openstreetmap"]
- },
:munin => {
:plugins => {
:chrony => {
:accounts => {
:users => {
:rails => {
- :status => :role,
:members => [:tomh, :grant]
}
}
--- /dev/null
+{
+ "id": "rails",
+ "uid": "500",
+ "comment": "Rails",
+ "manage_home": false
+}
--- /dev/null
+{
+ "id": "license-keys",
+ "149244": "key"
+}
--- /dev/null
+{
+ "id": "passwords",
+ "secret_key_base": "base",
+ "potlatch2_key": "potlatch2",
+ "id_key": "id",
+ "oauth_key": "oauth",
+ "google_auth_secret": "google",
+ "facebook_auth_secret": "facebook",
+ "windowslive_auth_secret": "windowslive",
+ "github_auth_secret": "github",
+ "wikipedia_auth_secret": "wikipedia",
+ "mapquest_key": "mapquest",
+ "mapzen_valhalla_key": "mapzen-valhalla",
+ "thunderforest_key": "thunderforest",
+ "totp_key": "totp",
+ "aws_key": "aws"
+}
--- /dev/null
+{
+ "id": "piwik",
+ "location": "piwik",
+ "site": 100,
+ "goals": {
+ "signup": 1001,
+ "mapnik": 1002,
+ "cyclemap": 1003,
+ "transportmap": 1004,
+ "mapquest": 1005
+ }
+}
--- /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
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe service("cgimap") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+describe port(8000) do
+ it { should be_listening.with("tcp") }
+end
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe service("api-statistics") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+describe service("rails-jobs@storage") do
+ it { should be_enabled }
+ it { should be_running }
+end
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe service("cgimap") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+describe port(8000) do
+ it { should be_listening.with("tcp") }
+end
--- /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
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe service("api-statistics") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+describe service("rails-jobs@mailers") do
+ it { should be_enabled }
+ it { should be_running }
+end
--- /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
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe service("api-statistics") do
+ it { should be_enabled }
+ it { should be_running }
+end