Commit 53123feffc0c7f2628eb2cb222e0fb5707b9da0b

Authored by Paulo Tada
Committed by Rafael Manzo
1 parent 267c15b0
Exists in mezuro_cookbook

Configuring postgresql with mezuro

Not complete tested with prezento and kalibro

Signed-off-by: Diego Araújo <diegoamc90@gmail.com>
cookbooks/postgresql/recipes/mezuro.rb 0 → 100644
... ... @@ -0,0 +1,50 @@
  1 +# Kalibro Processor
  2 +execute 'createuser:kalibro_processor' do
  3 + command 'createuser kalibro_processor'
  4 + user 'postgres'
  5 + only_if do
  6 + `sudo -u postgres -i psql --quiet --tuples-only -c "select count(*) from pg_user where usename = 'kalibro_processor';"`.strip.to_i == 0
  7 + end
  8 +end
  9 +
  10 +execute 'createdb:kalibro_processor' do
  11 + command 'createdb --owner=kalibro_processor kalibro_processor'
  12 + user 'postgres'
  13 + only_if do
  14 + `sudo -u postgres -i psql --quiet --tuples-only -c "select count(1) from pg_database where datname = 'kalibro_processor';"`.strip.to_i == 0
  15 + end
  16 +end
  17 +
  18 +# Kalibro Configurations
  19 +execute 'createuser:kalibro_configurations' do
  20 + command 'createuser kalibro_configurations'
  21 + user 'postgres'
  22 + only_if do
  23 + `sudo -u postgres -i psql --quiet --tuples-only -c "select count(*) from pg_user where usename = 'kalibro_configurations';"`.strip.to_i == 0
  24 + end
  25 +end
  26 +
  27 +execute 'createdb:kalibro_configurations' do
  28 + command 'createdb --owner=kalibro_configurations kalibro_configurations'
  29 + user 'postgres'
  30 + only_if do
  31 + `sudo -u postgres -i psql --quiet --tuples-only -c "select count(1) from pg_database where datname = 'kalibro_configurations';"`.strip.to_i == 0
  32 + end
  33 +end
  34 +
  35 +# Prezento
  36 +execute 'createuser:prezento' do
  37 + command 'createuser prezento'
  38 + user 'postgres'
  39 + only_if do
  40 + `sudo -u postgres -i psql --quiet --tuples-only -c "select count(*) from pg_user where usename = 'prezento';"`.strip.to_i == 0
  41 + end
  42 +end
  43 +
  44 +execute 'createdb:prezento' do
  45 + command 'createdb --owner=prezento prezento'
  46 + user 'postgres'
  47 + only_if do
  48 + `sudo -u postgres -i psql --quiet --tuples-only -c "select count(1) from pg_database where datname = 'prezento';"`.strip.to_i == 0
  49 + end
  50 +end
... ...
cookbooks/postgresql/templates/centos/pg_hba.conf.erb
... ... @@ -11,3 +11,8 @@ host colab colab &lt;%= node[&#39;peers&#39;][&#39;integration&#39;] %&gt;/32 trust
11 11 host gitlab gitlab <%= node['peers']['integration'] %>/32 trust
12 12 host noosfero noosfero <%= node['peers']['social'] %>/32 trust
13 13 host noosfero colab <%= node['peers']['integration'] %>/32 trust
  14 +
  15 +host kalibro_processor kalibro_processor <%= node['peers']['mezuro'] %>/32 trust
  16 +host kalibro_configurations kalibro_configurations <%= node['peers']['integration'] %>/32 trust
  17 +host prezento prezento <%= node['peers']['integration'] %>/32 trust
  18 +
... ...