- recipe[accounts::default]
- recipe[chef::default]
- role[otrs]
+ - name: planet
+ run_list:
+ - recipe[planet::default]
+ - name: planet-dump
+ run_list:
+ - recipe[planet::dump]
+ - name: planet-notes
+ run_list:
+ - recipe[planet::notes]
+ attributes:
+ web:
+ readonly_database_host: readonly
+ - name: planet-replication
+ run_list:
+ - recipe[planet::replication]
+ attributes:
+ web:
+ readonly_database_host: readonly
- name: python
run_list:
- recipe[python::default]
- name: "Test Kitchen (otrs)"
script:
- bundle exec kitchen test otrs-ubuntu-1804
+ - name: "Test Kitchen (planet)"
+ script:
+ - bundle exec kitchen test planet-ubuntu-1804
+ - name: "Test Kitchen (planet::dump)"
+ script:
+ - bundle exec kitchen test planet-dump-ubuntu-1804
+ - name: "Test Kitchen (planet::notes)"
+ script:
+ - bundle exec kitchen test planet-notes-ubuntu-1804
+ - name: "Test Kitchen (planet::replication)"
+ script:
+ - bundle exec kitchen test planet-replication-ubuntu-1804
- name: "Test Kitchen (python)"
script:
- bundle exec kitchen test python-ubuntu-1804
include_recipe "networking"
-clients = search(:node, "roles:#{node[:bind][:clients]}")
-
-ipv4_clients = clients.collect do |client|
- client.ipaddresses(:family => :inet)
-end.flatten
-
-ipv6_clients = clients.collect do |client|
- client.ipaddresses(:family => :inet6)
-end.flatten
+ipv4_clients = []
+ipv6_clients = []
package "bind9"
+default[:accounts][:users][:planet][:status] = :role
+
default[:planet][:dump][:xml_directory] = "/store/planet/planet"
default[:planet][:dump][:xml_history_directory] = "/store/planet/planet/full-history"
default[:planet][:dump][:pbf_directory] = "/store/planet/pbf"
version "1.0.0"
supports "ubuntu"
+depends "accounts"
depends "apache"
depends "git"
-depends "osmosis"
depends "incron"
depends "munin"
+depends "osmosis"
# limitations under the License.
#
+include_recipe "accounts"
include_recipe "apache"
package %w[
owner "www-data"
group "www-data"
mode 0o755
+ recursive true
end
%w[planetdump planet-mirror-redirect-update].each do |program|
# limitations under the License.
#
+include_recipe "accounts"
include_recipe "osmosis"
db_passwords = data_bag_item("db", "passwords")
package "ruby-dev"
package "ruby-libxml"
-package "libpq-dev"
-gem_package "pg"
-
package "make"
package "gcc"
+package "libpq-dev"
+
+gem_package "pg"
remote_directory "/opt/flush" do
source "flush"
description "Role applied to all planet servers"
default_attributes(
- :accounts => {
- :users => {
- :bretth => { :status => :user },
- :planet => {
- :status => :administrator,
- :members => [:bretth]
- }
- }
- },
:rsyncd => {
:modules => {
:planet => {
--- /dev/null
+{
+ "id": "planet",
+ "uid": "502",
+ "comment": "planet.openstreetmap.org"
+}
--- /dev/null
+{
+ "id": "passwords",
+ "openstreetmap": "openstreetmap-password",
+ "rails": "rails-password",
+ "cgimap": "cgimap-password",
+ "planetdump": "planetdump-password",
+ "planetdiff": "planetdiff-password",
+ "backup": "backup-password",
+ "gpximport": "gpximport-password",
+ "munin": "munin-password",
+ "replication": "replication-password"
+}
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe file("/opt/planet-dump-ng/planet-dump-ng") do
+ it { should be_file }
+ it { should be_executable }
+end
+
+describe file("/usr/local/bin/planetdump") do
+ it { should be_file }
+ it { should be_executable }
+end
+
+describe file("/usr/local/bin/planet-mirror-redirect-update") do
+ it { should be_file }
+ it { should be_executable }
+end
+
+describe file("/etc/cron.d/planet-dump-mirror") do
+ it { should be_file }
+end
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe file("/usr/local/bin/planet-notes-dump") do
+ it { should be_file }
+ it { should be_executable }
+end
+
+describe file("/etc/cron.d/planet-notes-dump") do
+ it { should be_file }
+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