The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.

Tuesday, June 11, 2013

Vagrant and puppet postgres 9.2 on ubuntu

Some vagrant configuration to install postgres 9.2 using puppet

exec {
"apt-get update":
path => "/usr/bin"
}
# manage_package_repo => true will satisfy apt_postgresql_org
# include postgresql::package_source::apt_postgresql_org
class { 'postgresql':
version => '9.2',
manage_package_repo => true,
charset => 'UTF8',
locale => 'en_US.UTF-8'
}
class { 'postgresql::server':
}
postgresql::db { 'mydatabasename':
user => 'mydatabaseuser',
password => 'mypassword'
}
view raw default.pp hosted with ❤ by GitHub

# 1) install puppet locally
# - install modules to local modules directory
# puppet module install puppetlabs/postgresql --force -i modules
# puppet module install puppetlabs/stdlib --force -i modules
# puppet module install puppetlabs/firewall --force -i modules
# puppet module install puppetlabs/apt --force -i modules
# puppet module install ripienaar/concat --force -i modules
# OR
# download tar file from https://forge.puppetlabs.com/puppetlabs/postgresql
# and place into modules directory
# 2) create a manifests/default.pp file - see https://gist.github.com/house9/5762219
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.provision :puppet do |puppet|
puppet.module_path = "./modules"
end
end
# 3) vagrant up
view raw Vagrantfile hosted with ❤ by GitHub

Resources

No comments: