]> git.openstreetmap.org Git - chef.git/commitdiff
Initial work on a chef cookbook for the GPS tile server
authorTom Hughes <tom@compton.nu>
Wed, 16 Oct 2013 16:43:19 +0000 (17:43 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 16 Oct 2013 16:43:19 +0000 (17:43 +0100)
cookbooks/gps-tile/README.md [new file with mode: 0644]
cookbooks/gps-tile/metadata.rb [new file with mode: 0644]
cookbooks/gps-tile/recipes/default.rb [new file with mode: 0644]
roles/gps-tile.rb [new file with mode: 0644]
roles/gpx-tile.rb [deleted file]
roles/noquiklos.rb

diff --git a/cookbooks/gps-tile/README.md b/cookbooks/gps-tile/README.md
new file mode 100644 (file)
index 0000000..6b08769
--- /dev/null
@@ -0,0 +1,57 @@
+DESCRIPTION
+===========
+
+Configures networking.
+
+USAGE
+=====
+
+Set the networking attributes in a role, for example from my base.rb:
+
+    :networking => {
+      :nameservers => [ "10.13.37.120", "10.13.37.40" ],
+      :search => [ "int.example.org". "example.org" ]
+    }
+
+The resulting /etc/resolv.conf will look like:
+
+    search int.example.org example.org
+    nameserver 10.13.37.120
+    nameserver 10.13.37.40
+
+LICENSE AND AUTHOR
+==================
+
+Author:: OpenStreetMap Administrators (<admins@openstreetmap.org>)
+
+Copyright 2010, OpenStreetMap Foundation.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Based on resolver cookbook:
+
+Author:: Joshua Timberman (<joshua@opscode.com>)
+
+Copyright 2009, Opscode, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/cookbooks/gps-tile/metadata.rb b/cookbooks/gps-tile/metadata.rb
new file mode 100644 (file)
index 0000000..243bd52
--- /dev/null
@@ -0,0 +1,7 @@
+maintainer        "OpenStreetMap Administrators"
+maintainer_email  "admins@openstreetmap.org"
+license           "Apache 2.0"
+description       "Configures a GPS tile server"
+long_description  IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version           "1.0.0"
+depends           "apache"
diff --git a/cookbooks/gps-tile/recipes/default.rb b/cookbooks/gps-tile/recipes/default.rb
new file mode 100644 (file)
index 0000000..ab524ab
--- /dev/null
@@ -0,0 +1,85 @@
+#
+# Cookbook Name:: gps-tile
+# Recipe:: default
+#
+# Copyright 2013, OpenStreetMap Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "apache"
+
+package "make"
+package "build-essential"
+package "pkg-config"
+package "zlib1g-dev"
+package "libbz2-dev"
+package "libarchive-dev"
+package "libexpat1-dev"
+package "libpng-dev"
+package "pngquant"
+package "libcache-memcached-perl"
+
+directory "/srv/gps-tile.openstreetmap.org" do
+  owner "gpstile"
+  group "gpstile"
+  mode 0755
+end
+
+git "/srv/gps-tile.openstreetmap.org/import" do
+  action :sync
+  repository "git://github.com/ericfischer/gpx-import.git"
+  revision "master"
+  user "gpstile"
+  group "gpstile"
+end
+
+execute "import-make" do
+  action :nothing
+  command "make"
+  cwd "/srv/gps-tile.openstreetmap.org/import"
+  user "gpstile"
+  group "gpstile"
+  subscribes :run, "git[/srv/gps-tile.openstreetmap.org/import]"
+end
+
+git "/srv/gps-tile.openstreetmap.org/datamaps" do
+  action :sync
+  repository "git://github.com/ericfischer/datamaps.git"
+  revision "master"
+  user "gpstile"
+  group "gpstile"
+end
+
+execute "datamaps-make" do
+  action :nothing
+  command "make"
+  cwd "/srv/gps-tile.openstreetmap.org/datamaps"
+  user "gpstile"
+  group "gpstile"
+  subscribes :run, "git[/srv/gps-tile.openstreetmap.org/datamaps]"
+end
+
+git "/srv/gps-tile.openstreetmap.org/updater" do
+  action :sync
+  repository "git://github.com/ericfischer/gpx-updater.git"
+  revision "master"
+  user "gpstile"
+  group "gpstile"
+end
+
+directory "/srv/gps-tile.openstreetmap.org/html" do
+  owner "gpstile"
+  group "gpstile"
+  mode 0755
+end
diff --git a/roles/gps-tile.rb b/roles/gps-tile.rb
new file mode 100644 (file)
index 0000000..0b20f71
--- /dev/null
@@ -0,0 +1,16 @@
+name "gps-tile"
+description "Role applied to all GPS tile servers"
+
+default_attributes(
+  :accounts => {
+    :users => {
+      :gpstile => :role,
+      :enf => { :status => :administrator }
+    }
+  }
+)
+
+run_list(
+  "recipe[memcached]",
+  "recipe[gps-tile]"
+)
diff --git a/roles/gpx-tile.rb b/roles/gpx-tile.rb
deleted file mode 100644 (file)
index 522f684..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-name "gpx-tile"
-description "Role applied to all GPX tile servers"
-
-default_attributes(
-  :accounts => {
-    :users => {
-      :enf => { :status => :administrator }
-    }
-  }
-)
index 465424116e18ccf0c159a322b48513fb8652541c..8e24fd027fac552c9350413d84b9b64d1f1f819d 100644 (file)
@@ -22,5 +22,5 @@ default_attributes(
 
 run_list(
   "role[ucl-internal]",
-  "role[gpx-tile]"
+  "role[gps-tile]"
 )