Skip to content

Instantly share code, notes, and snippets.

@mullr
Last active February 21, 2017 19:32
Show Gist options
  • Save mullr/c09d87332edb5fb074c298620fd3df24 to your computer and use it in GitHub Desktop.
Save mullr/c09d87332edb5fb074c298620fd3df24 to your computer and use it in GitHub Desktop.
basic pdb setup on oracle linux 7.3
[database]
log-slow-statements = 10
subname = //localhost:5432/puppetdb
username = puppetdb
password = puppetdb
local all all peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/ol73"
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "4096"
end
config.vm.provision "shell", inline: <<-SHELL
yum install http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-2.noarch.rpm -y
yum localinstall http://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm -y
yum update -y
yum install postgresql94-server postgresql94-contrib -y
/usr/pgsql-9.4/bin/postgresql94-setup initdb
yes | cp /vagrant/pg_hba.conf /var/lib/pgsql/9.4/data/
systemctl enable postgresql-9.4.service
systemctl start postgresql-9.4.service
cd /
sudo -u postgres psql -c "create user puppetdb password 'puppetdb'"
sudo -u postgres psql -c "create database puppetdb owner puppetdb";
yum install puppetdb -y
yes | cp /vagrant/database.ini /etc/puppetlabs/puppetdb/conf.d/
systemctl start puppetdb
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment