Commit 267c15b063ae3641c646888f1f78252e5140f720

Authored by Paulo Tada
Committed by Rafael Manzo
1 parent 724c4825
Exists in mezuro_cookbook

Adding mezuro cookbooks

Have 3 main recipes
- [to test]   kalibro_configurations.rb
- [complete]  kalibro_processor.rb
- [to do]     prezento.rb

Signed-off-by: Diego Araújo <diegoamc90@gmail.com>
cookbooks/mezuro/recipes/default.rb 0 → 100644
@@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
  1 +# Install kalibro configuration
  2 +# TODO: change the repo
  3 +execute 'download:repo' do
  4 + command 'wget https://copr.fedoraproject.org/coprs/ribeiro/athos-spb/repo/epel-7/ribeiro-athos-spb-epel-7.repo'
  5 + cwd '/etc/yum.repos.d'
  6 + user 'root'
  7 +end
  8 +
  9 +execute 'download:mezuro' do
  10 + command 'wget https://bintray.com/mezurometrics/rpm/rpm -O bintray-mezurometrics-rpm.repo'
  11 + cwd '/etc/yum.repos.d'
  12 + user 'root'
  13 +end
  14 +
  15 +package 'kalibro-configurations-deps'
  16 +package 'kalibro-configurations'
  17 +package 'kalibro-processor'
  18 +
  19 +service 'kalibro_configurations' do
  20 + action [:enable, :start]
  21 +end
  22 +
  23 +template '/etc/kalibro-configurations/database.yml' do
  24 + source 'kalibro_configurations/database.yml.erb'
  25 + owner 'kalibro_configurations'
  26 + group 'kalibro_configurations'
  27 + mode '0600'
  28 + notifies :restart, 'service[kalibro_configurations]'
  29 +end
  30 +
  31 +template '/etc/kalibro-processor/database.yml' do
  32 + source 'kalibro_processor/database.yml.erb'
  33 + owner 'kalibro_processor'
  34 + group 'kalibro_processor'
  35 + mode '0600'
  36 + action :nothing
  37 + #notifies :restart, 'service[kalibro_processor]'
  38 +end
  39 +
cookbooks/mezuro/recipes/kalibro_configurations.rb 0 → 100644
@@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
  1 +# TODO: remove before define main repo
  2 +execute 'download:mezuro' do
  3 + command 'wget https://bintray.com/mezurometrics/rpm/rpm -O bintray-mezurometrics-rpm.repo'
  4 + cwd '/etc/yum.repos.d'
  5 + user 'root'
  6 +end
  7 +
  8 +package 'kalibro-configurations'
  9 +
  10 +service 'kalibro-configurations' do
  11 + action [:enable, :start]
  12 +end
  13 +
  14 +template '/etc/mezuro/kalibro-configurations/database.yml' do
  15 + source 'kalibro_configurations/database.yml.erb'
  16 + owner 'kalibro_configurations'
  17 + group 'kalibro_configurations'
  18 + mode '0600'
  19 + notifies :restart, 'service[kalibro-configurations]'
  20 +end
cookbooks/mezuro/recipes/kalibro_processor.rb 0 → 100644
@@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
  1 +execute 'download:mezuro' do
  2 + command 'wget https://bintray.com/mezurometrics/rpm/rpm -O bintray-mezurometrics-rpm.repo'
  3 + cwd '/etc/yum.repos.d'
  4 + user 'root'
  5 +end
  6 +
  7 +package 'kalibro-processor'
  8 +
  9 +service 'kalibro-processor.target' do
  10 + action [:enable, :start]
  11 +end
  12 +
  13 +template '/etc/mezuro/kalibro-processor/database.yml' do
  14 + source 'kalibro_processor/database.yml.erb'
  15 + owner 'kalibro_processor'
  16 + group 'kalibro_processor'
  17 + mode '0600'
  18 + notifies :restart, 'service[kalibro-processor.target]'
  19 +end
  20 +
cookbooks/mezuro/recipes/prezento.rb 0 → 100644
@@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
  1 +execute 'download:mezuro' do
  2 + command 'wget https://bintray.com/mezurometrics/rpm/rpm -O bintray-mezurometrics-rpm.repo'
  3 + cwd '/etc/yum.repos.d'
  4 + user 'root'
  5 +end
  6 +
  7 +package 'prezento'
  8 +
  9 +service 'prezento' do
  10 + action [:enable, :start]
  11 +end
  12 +
  13 +template '/etc/mezuro/prezento/database.yml' do
  14 + source 'prezento/database.yml.erb'
  15 + owner 'prezento'
  16 + group 'prezento'
  17 + mode '0600'
  18 + notifies :restart, 'service[prezento]'
  19 +end
  20 +
cookbooks/mezuro/templates/kalibro_configurations/database.yml.erb 0 → 100644
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
  1 +production:
  2 + adapter: postgresql
  3 + encoding: unicode
  4 + database: kalibro_configurations
  5 + user: kalibro_configurations
  6 + host: <%= node['peers']['database'] %>
cookbooks/mezuro/templates/kalibro_processor/database.yml.erb 0 → 100644
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
  1 +production:
  2 + adapter: postgresql
  3 + encoding: unicode
  4 + database: kalibro_processor
  5 + user: kalibro_processor
  6 + host: <%= node['peers']['database'] %>
cookbooks/mezuro/templates/prezento/database.yml.erb 0 → 100644
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
  1 +production:
  2 + adapter: postgresql
  3 + encoding: unicode
  4 + database: prezento
  5 + user: prezento
  6 + host: <%= node['peers']['database'] %>