Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
commit 6e226f96418f188e8505f10e919cd3223096b92a 2 parents d2593d5 + 5585a66
Ron Hopper authored
24 cookbooks/api-keys-yml/recipes/default.rb
... ... @@ -1,14 +1,14 @@
1 1 if ['app_master', 'app'].include?(node[:instance_role])
2   -
3   - template "/data/#{app}/shared/config/api-keys.yml"do
4   - source 'api-keys.yml.erb'
5   - owner node[:owner_name]
6   - group node[:owner_name]
7   - mode 0655
8   - backup 0
9   - # Pass a hash of variables to the method below and they will be available as local variables in the template.
10   - # For API keys this is usually completely unnecessary
11   - # variables()
  2 + node[:applications].each do |app, data|
  3 + template "/data/#{app}/shared/config/api-keys.yml"do
  4 + source 'api-keys.yml.erb'
  5 + owner node[:owner_name]
  6 + group node[:owner_name]
  7 + mode 0655
  8 + backup 0
  9 + # Pass a hash of variables to the method below and they will be available as local variables in the template.
  10 + # For API keys this is usually completely unnecessary
  11 + # variables()
  12 + end
12 13 end
13   -
14   -end
  14 +end
7 cookbooks/main/recipes/default.rb
@@ -113,7 +113,12 @@
113 113 # postgresql9_pg_trgm "dbname"
114 114 # postgresql9_pgcrypto "dbname"
115 115 # postgresql9_pgrowlocks "dbname"
116   - # postgresql9_postgis "dbname" - Only works for 9.0 and 9.1 atm
  116 +
  117 + # PostGis 1.5 (use with versions 9.0, 9.1, 9.2)
  118 + # postgresql9_postgis "dbname"
  119 +
  120 + # PostGis 2.0 (use with version 9.2)
  121 + # postgresql9_postgis2 "dbname"
117 122 # postgresql9_seg "dbname"
118 123 # postgresql9_sslinfo "dbname"
119 124 # postgresql9_tablefunc "dbname"
16 cookbooks/postgresql9_extensions/README.md
Source Rendered
@@ -277,8 +277,8 @@ extension applied to.
277 277
278 278 ``postgresql9_pg_stat_statements "dbname""``
279 279
280   -##PostGIS
281   -###supported versions: 9.0, 9.1
  280 +##PostGIS 1.5
  281 +###supported versions: 9.0, 9.1, 9.2
282 282 This extension adds support for geographic objects. PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend
283 283 spatial database for geographic information systems (GIS).
284 284
@@ -290,6 +290,18 @@ extension applied to.
290 290 ``postgresql9_postgis "dbname""``
291 291
292 292
  293 +##PostGIS 2.0
  294 +###supported versions: 9.2
  295 +This extension adds support for geographic objects. PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend
  296 +spatial database for geographic information systems (GIS).
  297 +
  298 +Enabling this extension:
  299 +
  300 +* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this
  301 +extension applied to.
  302 +
  303 +``postgresql9_postgis2 "dbname""``
  304 +
293 305 ##seg
294 306 ###supported versions: 9.0, 9.1, 9.2
295 307 This module implements a data type seg for representing line segments, or floating point intervals. seg can represent uncertainty in the
17 cookbooks/postgresql9_extensions/definitions/postgis.rb
@@ -21,22 +21,21 @@
21 21 supported_versions %w[9.0]
22 22 extname"postgis-1.5/postgis_comments"
23 23 end
24   - elsif @node[:postgres_version] == "9.1"
  24 + elsif ["9.1","9.2"].include?(@node[:postgres_version])
  25 + pgversion = @node[:postgres_version]
25 26 include_recipe "postgresql9_extensions::ext_postgis_install"
26 27
27   - execute "Postgresql loading postgis on database #{dbname_to_use} for version 9.1 as a contrib" do
28   - command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-9.1/contrib/postgis-1.5/postgis.sql"
  28 + execute "Postgresql loading postgis 1.5 on database #{dbname_to_use} for version #{pgversion}" do
  29 + command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-#{pgversion}/contrib/postgis-1.5/postgis.sql"
29 30 end
30 31
31   - execute "Postgresql loading spatial_ref_sys on database #{dbname_to_use} for version 9.1 as a contrib" do
32   - command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-9.1/contrib/postgis-1.5/spatial_ref_sys.sql"
  32 + execute "Postgresql loading spatial_ref_sys on database #{dbname_to_use} for version #{pgversion}" do
  33 + command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-#{pgversion}/contrib/postgis-1.5/spatial_ref_sys.sql"
33 34 end
34 35
35   - execute "Postgresql loading postgis_comments on database #{dbname_to_use} for version 9.1 as a contrib" do
36   - command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-9.1/contrib/postgis-1.5/postgis_comments.sql"
  36 + execute "Postgresql loading postgis_comments on database #{dbname_to_use} for version #{pgversion}" do
  37 + command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-#{pgversion}/contrib/postgis-1.5/postgis_comments.sql"
37 38 end
38   - elsif @node[:postgres_version] == "9.2"
39   - Chef::Log.info "PostGIS support for 9.2 is coming soon"
40 39 end
41 40
42 41 execute "Grant permissions to the deploy user on the geometry_columns schema" do
22 cookbooks/postgresql9_extensions/definitions/postgis2.rb
... ... @@ -0,0 +1,22 @@
  1 +define :postgresql9_postgis2 do
  2 + dbname_to_use = params[:name]
  3 +
  4 + if @node[:postgres_version] == "9.2"
  5 + include_recipe "postgresql9_extensions::ext_postgis2_install"
  6 +
  7 + load_sql_file do
  8 + db_name dbname_to_use
  9 + supported_versions %w[9.2]
  10 + extname "postgis"
  11 + end
  12 +
  13 + execute "Grant permissions to the deploy user on the geometry_columns schema" do
  14 + command "psql -U postgres -d #{dbname_to_use} -c \"GRANT all on geometry_columns to deploy\""
  15 + end
  16 +
  17 + execute "Grant permissions to the deploy user on the spatial_ref_sys schema" do
  18 + command "psql -U postgres -d #{dbname_to_use} -c \"GRANT all on spatial_ref_sys to deploy\""
  19 + end
  20 +
  21 + end
  22 +end
30 cookbooks/postgresql9_extensions/recipes/ext_postgis2_install.rb
... ... @@ -0,0 +1,30 @@
  1 +if @node[:postgres_version] == "9.2"
  2 + postgis_version = "2.0.2"
  3 + proj_version = "4.6.1"
  4 + geos_version = "3.2.2"
  5 + gdal_version = "1.8.1"
  6 +
  7 + package_use "sci-libs/geos" do
  8 + flags "-ruby"
  9 + end
  10 +
  11 + enable_package "sci-libs/gdal" do
  12 + version gdal_version
  13 + end
  14 +
  15 + enable_package "sci-libs/geos" do
  16 + version geos_version
  17 + end
  18 + enable_package "sci-libs/proj" do
  19 + version proj_version
  20 + end
  21 +
  22 + enable_package "dev-db/postgis" do
  23 + version postgis_version
  24 + end
  25 +
  26 + package "dev-db/postgis" do
  27 + version postgis_version
  28 + action :install
  29 + end
  30 +end
10 cookbooks/postgresql9_extensions/recipes/ext_postgis_install.rb
@@ -22,8 +22,13 @@
22 22 version postgis_version
23 23 action :install
24 24 end
25   -elsif @node[:postgres_version] == "9.1"
26   - postgis_version = "1.5.3-r1"
  25 +elsif ["9.1","9.2"].include?(@node[:postgres_version])
  26 + if @node[:postgres_version] == "9.1"
  27 + postgis_version = "1.5.3-r1"
  28 + else
  29 + postgis_version = "1.5.8"
  30 + end
  31 +
27 32 proj_version = "4.6.1"
28 33 geos_version = "3.2.2"
29 34
@@ -45,7 +50,6 @@
45 50 execute "setting emerge options" do
46 51 command "emerge --ignore-default-opts dev-db/postgis"
47 52 end
48   -elsif@node[:postgres_version] == "9.2"
49 53 end
50 54
51 55

0 comments on commit 6e226f9

Please sign in to comment.
Something went wrong with that request. Please try again.