Skip to content
Browse files

PG Extensions: corrections to the PostGIS recipe on 9.1 environments

  • Loading branch information...
1 parent 1323a41 commit a282012ad1b64eef2264aca5226658cb200f9a83 Ines Sombra committed
View
6 cookbooks/main/recipes/default.rb
@@ -80,7 +80,7 @@
#require_recipe "newrelic_server_monitoring"
#enable Extension modules for a given Postgresql database
-# if ['solo','db_master', 'db_slave'].include?(node[:instance_role])
+if ['solo','db_master', 'db_slave'].include?(node[:instance_role])
# Extensions that support both Postgres 9.0 and 9.1
# postgresql9_autoexplain "dbname"
# postgresql9_btree_gin "dbname"
@@ -101,7 +101,7 @@
# postgresql9_pg_trgm "dbname"
# postgresql9_pgcrypto "dbname"
# postgresql9_pgrowlocks "dbname"
- # postgresql9_postgis "dbname"
+ postgresql9_postgis "todo"
# postgresql9_seg "dbname"
# postgresql9_sslinfo "dbname"
# postgresql9_tablefunc "dbname"
@@ -119,4 +119,4 @@
# postgresql9_pg_freespacemap "postgres"
# postgresql9_pg_stat_statements "todo" - Not done
-# end
+end
View
8 cookbooks/postgresql9_extensions/definitions/postgis.rb
@@ -22,13 +22,8 @@
extname"postgis-1.5/postgis_comments"
end
elsif @node[:postgres_version] == "9.1"
-
- execute "setting emerge options" do
- command "emerge --ignore-default-opts dev-db/postgis"
- end
-
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"
end
@@ -43,7 +38,6 @@
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
View
53 cookbooks/postgresql9_extensions/recipes/ext_postgis_install.rb
@@ -2,30 +2,51 @@
postgis_version = "1.5.2"
proj_version = "4.6.1"
geos_version = "3.2.2"
+
+ package_use "sci-libs/geos" do
+ flags "-ruby"
+ 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
elsif @node[:postgres_version] == "9.1"
postgis_version = "1.5.3-r1"
proj_version = "4.6.1"
geos_version = "3.2.2"
-end
-package_use "sci-libs/geos" do
- flags "-ruby"
-end
+ package_use "sci-libs/geos" do
+ flags "-ruby"
+ end
-enable_package "sci-libs/geos" do
- version geos_version
-end
-enable_package "sci-libs/proj" do
- version proj_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
+ enable_package "dev-db/postgis" do
+ version postgis_version
+ end
+
+ execute "setting emerge options" do
+ command "emerge --ignore-default-opts dev-db/postgis"
+ end
-package "dev-db/postgis" do
- version postgis_version
- action :install
end
+

0 comments on commit a282012

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