Skip to content
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
2 parents d2593d5 + 5585a66 commit 6e226f96418f188e8505f10e919cd3223096b92a @ronhopper committed Mar 14, 2013
View
24 cookbooks/api-keys-yml/recipes/default.rb
@@ -1,14 +1,14 @@
if ['app_master', 'app'].include?(node[:instance_role])
-
- template "/data/#{app}/shared/config/api-keys.yml"do
- source 'api-keys.yml.erb'
- owner node[:owner_name]
- group node[:owner_name]
- mode 0655
- backup 0
- # Pass a hash of variables to the method below and they will be available as local variables in the template.
- # For API keys this is usually completely unnecessary
- # variables()
+ node[:applications].each do |app, data|
+ template "/data/#{app}/shared/config/api-keys.yml"do
+ source 'api-keys.yml.erb'
+ owner node[:owner_name]
+ group node[:owner_name]
+ mode 0655
+ backup 0
+ # Pass a hash of variables to the method below and they will be available as local variables in the template.
+ # For API keys this is usually completely unnecessary
+ # variables()
+ end
end
-
-end
+end
View
7 cookbooks/main/recipes/default.rb
@@ -113,7 +113,12 @@
# postgresql9_pg_trgm "dbname"
# postgresql9_pgcrypto "dbname"
# postgresql9_pgrowlocks "dbname"
- # postgresql9_postgis "dbname" - Only works for 9.0 and 9.1 atm
+
+ # PostGis 1.5 (use with versions 9.0, 9.1, 9.2)
+ # postgresql9_postgis "dbname"
+
+ # PostGis 2.0 (use with version 9.2)
+ # postgresql9_postgis2 "dbname"
# postgresql9_seg "dbname"
# postgresql9_sslinfo "dbname"
# postgresql9_tablefunc "dbname"
View
16 cookbooks/postgresql9_extensions/README.md
@@ -277,8 +277,8 @@ extension applied to.
``postgresql9_pg_stat_statements "dbname""``
-##PostGIS
-###supported versions: 9.0, 9.1
+##PostGIS 1.5
+###supported versions: 9.0, 9.1, 9.2
This extension adds support for geographic objects. PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend
spatial database for geographic information systems (GIS).
@@ -290,6 +290,18 @@ extension applied to.
``postgresql9_postgis "dbname""``
+##PostGIS 2.0
+###supported versions: 9.2
+This extension adds support for geographic objects. PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend
+spatial database for geographic information systems (GIS).
+
+Enabling this extension:
+
+* Edit main/recipes/default.rb and comment out the line shown below. Replace dbname with the name of the database you want this
+extension applied to.
+
+``postgresql9_postgis2 "dbname""``
+
##seg
###supported versions: 9.0, 9.1, 9.2
This module implements a data type seg for representing line segments, or floating point intervals. seg can represent uncertainty in the
View
17 cookbooks/postgresql9_extensions/definitions/postgis.rb
@@ -21,22 +21,21 @@
supported_versions %w[9.0]
extname"postgis-1.5/postgis_comments"
end
- elsif @node[:postgres_version] == "9.1"
+ elsif ["9.1","9.2"].include?(@node[:postgres_version])
+ pgversion = @node[:postgres_version]
include_recipe "postgresql9_extensions::ext_postgis_install"
- execute "Postgresql loading postgis on database #{dbname_to_use} for version 9.1 as a contrib" do
- command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-9.1/contrib/postgis-1.5/postgis.sql"
+ execute "Postgresql loading postgis 1.5 on database #{dbname_to_use} for version #{pgversion}" do
+ command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-#{pgversion}/contrib/postgis-1.5/postgis.sql"
end
- execute "Postgresql loading spatial_ref_sys on database #{dbname_to_use} for version 9.1 as a contrib" do
- command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-9.1/contrib/postgis-1.5/spatial_ref_sys.sql"
+ execute "Postgresql loading spatial_ref_sys on database #{dbname_to_use} for version #{pgversion}" do
+ command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-#{pgversion}/contrib/postgis-1.5/spatial_ref_sys.sql"
end
- execute "Postgresql loading postgis_comments on database #{dbname_to_use} for version 9.1 as a contrib" do
- command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-9.1/contrib/postgis-1.5/postgis_comments.sql"
+ execute "Postgresql loading postgis_comments on database #{dbname_to_use} for version #{pgversion}" do
+ command "psql -U postgres -d #{dbname_to_use} -f /usr/share/postgresql-#{pgversion}/contrib/postgis-1.5/postgis_comments.sql"
end
- elsif @node[:postgres_version] == "9.2"
- Chef::Log.info "PostGIS support for 9.2 is coming soon"
end
execute "Grant permissions to the deploy user on the geometry_columns schema" do
View
22 cookbooks/postgresql9_extensions/definitions/postgis2.rb
@@ -0,0 +1,22 @@
+define :postgresql9_postgis2 do
+ dbname_to_use = params[:name]
+
+ if @node[:postgres_version] == "9.2"
+ include_recipe "postgresql9_extensions::ext_postgis2_install"
+
+ load_sql_file do
+ db_name dbname_to_use
+ supported_versions %w[9.2]
+ extname "postgis"
+ end
+
+ execute "Grant permissions to the deploy user on the geometry_columns schema" do
+ command "psql -U postgres -d #{dbname_to_use} -c \"GRANT all on geometry_columns to deploy\""
+ end
+
+ execute "Grant permissions to the deploy user on the spatial_ref_sys schema" do
+ command "psql -U postgres -d #{dbname_to_use} -c \"GRANT all on spatial_ref_sys to deploy\""
+ end
+
+ end
+end
View
30 cookbooks/postgresql9_extensions/recipes/ext_postgis2_install.rb
@@ -0,0 +1,30 @@
+if @node[:postgres_version] == "9.2"
+ postgis_version = "2.0.2"
+ proj_version = "4.6.1"
+ geos_version = "3.2.2"
+ gdal_version = "1.8.1"
+
+ package_use "sci-libs/geos" do
+ flags "-ruby"
+ end
+
+ enable_package "sci-libs/gdal" do
+ version gdal_version
+ end
+
+ enable_package "sci-libs/geos" do
+ version geos_version
+ end
+ enable_package "sci-libs/proj" do
+ version proj_version
+ end
+
+ enable_package "dev-db/postgis" do
+ version postgis_version
+ end
+
+ package "dev-db/postgis" do
+ version postgis_version
+ action :install
+ end
+end
View
10 cookbooks/postgresql9_extensions/recipes/ext_postgis_install.rb
@@ -22,8 +22,13 @@
version postgis_version
action :install
end
-elsif @node[:postgres_version] == "9.1"
- postgis_version = "1.5.3-r1"
+elsif ["9.1","9.2"].include?(@node[:postgres_version])
+ if @node[:postgres_version] == "9.1"
+ postgis_version = "1.5.3-r1"
+ else
+ postgis_version = "1.5.8"
+ end
+
proj_version = "4.6.1"
geos_version = "3.2.2"
@@ -45,7 +50,6 @@
execute "setting emerge options" do
command "emerge --ignore-default-opts dev-db/postgis"
end
-elsif@node[:postgres_version] == "9.2"
end

0 comments on commit 6e226f9

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