Skip to content

Instantly share code, notes, and snippets.

@mriddle
Last active December 20, 2015 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mriddle/6100069 to your computer and use it in GitHub Desktop.
Save mriddle/6100069 to your computer and use it in GitHub Desktop.
diff --git a/cookbooks/spp/recipes/postgis.rb b/cookbooks/spp/recipes/postgis.rb
index a893070..26a0edc 100644
--- a/cookbooks/spp/recipes/postgis.rb
+++ b/cookbooks/spp/recipes/postgis.rb
@@ -1,4 +1,45 @@
-package "postgresql-9.1-postgis"
+
+
+#http://linfiniti.com/2012/05/installing-postgis-2-0-on-ubuntu/
+#https://github.com/realityforge/chef-postgis/blob/master/recipes/default.rb
+
+package "postgresql-9.1-postgis" do
+ action :remove
+end
+
+apt_repository 'ppa_sharpie_for-science' do
+ uri 'http://ppa.launchpad.net/sharpie/for-science/ubuntu'
+ distribution node['lsb']['codename']
+ components ["main"]
+ keyserver 'keyserver.ubuntu.com'
+ key 'DAF764E2'
+ deb_src true
+ action :add
+end
+
+apt_repository 'ppa_sharpie_postgis-stable' do
+ uri 'http://ppa.launchpad.net/sharpie/postgis-stable/ubuntu'
+ distribution node['lsb']['codename']
+ components ['main']
+ keyserver 'keyserver.ubuntu.com'
+ key 'DAF764E2'
+ deb_src true
+ action :add
+end
+
+apt_repository 'ppa_ubuntugis_ubuntugis-unstable' do
+ uri 'http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu'
+ distribution node['lsb']['codename']
+ components ['main']
+ keyserver 'keyserver.ubuntu.com'
+ key '314DF160'
+ deb_src true
+ action :add
+ notifies :run, "execute[apt-get update]", :immediately
+end
+
+package 'python-software-properties'
+package 'postgresql-9.1-postgis2'
template "/tmp/create_postgis_template.sql" do
source "create_postgis_template.sql.erb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment