From: Tom Hughes Date: Wed, 16 Oct 2013 16:43:19 +0000 (+0100) Subject: Initial work on a chef cookbook for the GPS tile server X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/f68ae23a0afb7b8fb05a841774430874e4f21497 Initial work on a chef cookbook for the GPS tile server --- diff --git a/cookbooks/gps-tile/README.md b/cookbooks/gps-tile/README.md new file mode 100644 index 000000000..6b087690a --- /dev/null +++ b/cookbooks/gps-tile/README.md @@ -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 () + +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 () + +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 index 000000000..243bd528d --- /dev/null +++ b/cookbooks/gps-tile/metadata.rb @@ -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 index 000000000..ab524abcc --- /dev/null +++ b/cookbooks/gps-tile/recipes/default.rb @@ -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 index 000000000..0b20f713d --- /dev/null +++ b/roles/gps-tile.rb @@ -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 index 522f6844d..000000000 --- a/roles/gpx-tile.rb +++ /dev/null @@ -1,10 +0,0 @@ -name "gpx-tile" -description "Role applied to all GPX tile servers" - -default_attributes( - :accounts => { - :users => { - :enf => { :status => :administrator } - } - } -) diff --git a/roles/noquiklos.rb b/roles/noquiklos.rb index 465424116..8e24fd027 100644 --- a/roles/noquiklos.rb +++ b/roles/noquiklos.rb @@ -22,5 +22,5 @@ default_attributes( run_list( "role[ucl-internal]", - "role[gpx-tile]" + "role[gps-tile]" )