Created
July 17, 2013 14:55
-
-
Save clarkdave/6021315 to your computer and use it in GitHub Desktop.
(CHEF) Install PostgreSQL json_enhancements & hstore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package 'postgresql-server-dev-9.2' | |
| package 'postgresql-contrib-9.2' | |
| # without hstore this won't build without fiddling, so it's easiest just to install hstore too | |
| bash 'build_json_enhancements' do | |
| code <<-CODE | |
| cd /var/cache/chef | |
| wget https://bitbucket.org/qooleot/json_enhancements/get/master.tar.gz | |
| tar -xvzf master.tar.gz | |
| cd qooleot-json_enhancements* | |
| make | |
| make install | |
| CODE | |
| not_if { ::FileTest.exist?("/usr/share/postgresql/9.2/extension/json_enhancements.control") } | |
| notifies :run, 'bash[install_json_enhancements]', :immediately | |
| end | |
| bash 'install_json_enhancements' do | |
| user 'postgres' | |
| code <<-CODE | |
| psql template1 -c "CREATE EXTENSION hstore;" | |
| psql template1 -c "CREATE EXTENSION json_enhancements;" | |
| CODE | |
| action :nothing | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment