taginfo:
sites:
- name: taginfo.example.com
+ - name: tile
+ run_list:
+ - recipe[tile::default]
- name: tilecache
run_list:
- recipe[tilecache::default]
- name: "Test Kitchen (taginfo)"
script:
- bundle exec kitchen test taginfo-ubuntu-1804
+ - name: "Test Kitchen (tile)"
+ script:
+ - bundle exec kitchen test tile-ubuntu-1804
- name: "Test Kitchen (tilecache)"
script:
- bundle exec kitchen test tilecache-ubuntu-1804
+default[:tile][:database][:cluster] = "10/main"
+default[:tile][:database][:postgis] = "2.4"
+default[:tile][:database][:node_file] = "/store/database/nodes"
+default[:tile][:database][:multi_geometry] = true
+default[:tile][:database][:hstore] = true
+default[:tile][:database][:style_file] = nil
+default[:tile][:database][:tag_transform_script] = nil
+
default[:tile][:data] = {}
default[:tile][:styles] = {}
+
+default[:postgresql][:versions] |= ["10"]
+
+default[:accounts][:users][:tile][:status] = :role
version "1.0.0"
supports "ubuntu"
+depends "accounts"
depends "apache"
depends "git"
depends "munin"
# limitations under the License.
#
+include_recipe "accounts"
include_recipe "apache"
include_recipe "git"
include_recipe "munin"
postgresql_extension "hstore" do
cluster node[:tile][:database][:cluster]
database "gis"
+ only_if { node[:tile][:database][:hstore] }
end
%w[geography_columns planet_osm_nodes planet_osm_rels planet_osm_ways raster_columns raster_overviews spatial_ref_sys].each do |table|
database "gis"
end
-file node[:tile][:node_file] do
+directory File.dirname(node[:tile][:database][:node_file]) do
+ owner "root"
+ group "root"
+ mode 0o755
+ recursive true
+end
+
+file node[:tile][:database][:node_file] do
owner "tile"
group "www-data"
mode 0o660
#
SSLEngine on
SSLProxyEngine on
- SSLCertificateFile /etc/ssl/certs/<%= node.name %>.pem
- SSLCertificateKeyFile /etc/ssl/private/<%= node.name %>.key
+ SSLCertificateFile /etc/ssl/certs/<%= node[:fqdn] %>.pem
+ SSLCertificateKeyFile /etc/ssl/private/<%= node[:fqdn] %>.key
# Configure location of static files and CGI scripts
DocumentRoot /srv/tile.openstreetmap.org/html
# Apply the changes to the database
osm2pgsql --database gis --slim --append --number-processes=1 \
-<% if node[:tile][:node_file] -%>
- --flat-nodes=<%= node[:tile][:node_file] %> \
+<% if node[:tile][:database][:node_file] -%>
+ --flat-nodes=<%= node[:tile][:database][:node_file] %> \
<% end -%>
-<% if node[:tile][:styles][:default][:revision] >= "v4.0.0" -%>
- --multi-geometry --hstore \
- --style=/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.style \
- --tag-transform-script=/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.lua \
+<% if node[:tile][:database][:multi_geometry] -%>
+ --multi-geometry \
+<% end -%>
+<% if node[:tile][:database][:hstore] -%>
+ --hstore \
+<% end -%>
+<% if node[:tile][:database][:style_file] -%>
+ --style=<%= node[:tile][:database][:style_file] %> \
+<% end -%>
+<% if node[:tile][:database][:tag_transform_script] -%>
+ --tag-transform-script=<%= node[:tile][:database][:tag_transform_script] %> \
<% end -%>
${file}
:cluster => "10/main",
:postgis => "2.4"
},
- :node_file => "/store/database/nodes",
:styles => {
:default => {
:tile_directories => [
:cluster => "10/main",
:postgis => "2.4"
},
- :node_file => "/store/database/nodes",
:styles => {
:default => {
:tile_directories => [
:cluster => "10/main",
:postgis => "2.4"
},
- :node_file => "/store/database/nodes",
:styles => {
:default => {
:tile_directories => [
:cluster => "10/main",
:postgis => "2.4"
},
- :node_file => "/store/database/nodes",
:styles => {
:default => {
:tile_directories => [
:cluster => "10/main",
:postgis => "2.4"
},
- :node_file => "/store/database/nodes",
:styles => {
:default => {
:tile_directories => [
:accounts => {
:users => {
:tile => {
- :status => :role,
:members => [:jburgess, :tomh]
}
}
}
},
:tile => {
+ :database => {
+ :style_file => "/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.style",
+ :tag_transform_script => "/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.lua"
+ },
:data => {
:simplified_land_polygons => {
:url => "https://osmdata.openstreetmap.de/download/simplified-land-polygons-complete-3857.zip",
:cluster => "10/main",
:postgis => "2.4"
},
- :node_file => "/store/database/nodes",
:styles => {
:default => {
:tile_directories => [
--- /dev/null
+{
+ "id": "tile",
+ "uid": "515",
+ "comment": "tile.openstreetmap.org",
+ "home": "/srv/tile.openstreetmap.org"
+}
--- /dev/null
+{
+ "id": "blocks",
+ "user_agents": [
+ "dummy"
+ ],
+ "referers": [
+ "https://www.example.com/"
+ ]
+}
--- /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