Merge Request #246
← To merge requests
From
hot-fix-cookbook
into
master
Fix cookbook
Fix of cookbooks and env configs
Removing workaround of monitor recipes; Removing sentry plugin file from colab; Workaround for gitlab precompile; Refactoring recipe mezuro::default; Refactoring recipe rsyslog; Refactoring runlists;
Commits (8)
-
And removing screen from basic recipe. Already has tmux.
-
Modularizing the mezuro RPM repo
-
Workaround: it's was using the reverseproxy as monitor Updating configs of dev, lappis and local
Showing
20 changed files
Show diff stats
Rakefile
@@ -65,12 +65,6 @@ $nodes.each do |node| | @@ -65,12 +65,6 @@ $nodes.each do |node| | ||
65 | node.data['firewall'] = firewall | 65 | node.data['firewall'] = firewall |
66 | end | 66 | end |
67 | 67 | ||
68 | -# In the absence of a dedicated munin master, reverseproxy will do that. | ||
69 | -if !config['munin_master'] | ||
70 | - config['munin_master'] = ips['reverseproxy'] | ||
71 | - $nodes.find { |node| node.hostname == 'reverseproxy' }.data['run_list'] << 'role[monitoring_server]' | ||
72 | -end | ||
73 | - | ||
74 | task :console do | 68 | task :console do |
75 | require 'pry' | 69 | require 'pry' |
76 | binding.pry | 70 | binding.pry |
Vagrantfile
@@ -61,7 +61,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | @@ -61,7 +61,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
61 | end | 61 | end |
62 | end | 62 | end |
63 | 63 | ||
64 | - config.vm.define 'reverseproxy', autostart: false do |reverseproxy| | 64 | + config.vm.define 'reverseproxy' do |reverseproxy| |
65 | reverseproxy.vm.provider "virtualbox" do |vm, override| | 65 | reverseproxy.vm.provider "virtualbox" do |vm, override| |
66 | override.vm.network 'private_network', ip: ips['reverseproxy'] if ips | 66 | override.vm.network 'private_network', ip: ips['reverseproxy'] if ips |
67 | end | 67 | end |
config/dev/config.yaml
1 | +rpm_repository: https://copr-be.cloud.fedoraproject.org/results/softwarepublico/v5/epel-7-$basearch/ | ||
2 | +rpm_gpgkey: https://copr-be.cloud.fedoraproject.org/results/softwarepublico/v5/pubkey.gpg | ||
1 | admins: | 3 | admins: |
2 | - ["Paulo Meirelles", "paulo@softwarelivre.org"] | 4 | - ["Paulo Meirelles", "paulo@softwarelivre.org"] |
5 | +site_url: https://dev.softwarepublico.gov.br | ||
3 | external_hostname: dev.softwarepublico.gov.br | 6 | external_hostname: dev.softwarepublico.gov.br |
4 | monitor_external_hostname: status.dev.softwarepublico.gov.br | 7 | monitor_external_hostname: status.dev.softwarepublico.gov.br |
5 | -external_ip: 189.9.151.16 | ||
6 | alternative_hostnames: | 8 | alternative_hostnames: |
7 | - www.dev.softwarepublico.gov.br | 9 | - www.dev.softwarepublico.gov.br |
8 | -site_url: https://dev.softwarepublico.gov.br | 10 | +external_ip: 189.9.151.16 |
11 | +alt_ssh_port: 55555 | ||
9 | colab_from_address: '"Portal do Software Publico (dev)" <noreply@dev.softwarepublico.gov.br>' | 12 | colab_from_address: '"Portal do Software Publico (dev)" <noreply@dev.softwarepublico.gov.br>' |
10 | server_email: '"Portal do Software Publico (dev)" <noreply@dev.softwarepublico.gov.br>' | 13 | server_email: '"Portal do Software Publico (dev)" <noreply@dev.softwarepublico.gov.br>' |
11 | email_subject_prefix: '[spb|dev]' | 14 | email_subject_prefix: '[spb|dev]' |
@@ -15,9 +18,9 @@ from_address: noreply@dev.softwarepublico.gov.br | @@ -15,9 +18,9 @@ from_address: noreply@dev.softwarepublico.gov.br | ||
15 | relay_hostname: relay.dev.softwarepublico.gov.br | 18 | relay_hostname: relay.dev.softwarepublico.gov.br |
16 | relay_ip: 189.9.151.44 | 19 | relay_ip: 189.9.151.44 |
17 | external_outgoing_mail_relay: 189.9.150.53 | 20 | external_outgoing_mail_relay: 189.9.150.53 |
18 | -alt_ssh_port: 55555 | ||
19 | external_outgoing_mail_domain: serpro.gov.br | 21 | external_outgoing_mail_domain: serpro.gov.br |
20 | raven_dsn: https://a5e2f92a83774dfc9de66486e0fe970b:1a9229a4e1d2483582144d302fb53115@sentry.tracy.com.br/19 | 22 | raven_dsn: https://a5e2f92a83774dfc9de66486e0fe970b:1a9229a4e1d2483582144d302fb53115@sentry.tracy.com.br/19 |
21 | google_analytics_id: 'UA-64206731-2' | 23 | google_analytics_id: 'UA-64206731-2' |
24 | +munin_master: 10.18.0.21 | ||
22 | dev_backup_frequency: true | 25 | dev_backup_frequency: true |
23 | disable_send_emails: true | 26 | disable_send_emails: true |
config/lappis/config.yaml
1 | +rpm_repository: https://copr-be.cloud.fedoraproject.org/results/softwarepublico/v5/epel-7-$basearch/ | ||
2 | +rpm_gpgkey: https://copr-be.cloud.fedoraproject.org/results/softwarepublico/v5/pubkey.gpg | ||
1 | admins: | 3 | admins: |
2 | - ["Paulo Meirelles", "paulo@softwarelivre.org"] | 4 | - ["Paulo Meirelles", "paulo@softwarelivre.org"] |
3 | site_url: https://softwarepublico.lappis | 5 | site_url: https://softwarepublico.lappis |
4 | external_hostname: softwarepublico.lappis | 6 | external_hostname: softwarepublico.lappis |
5 | monitor_external_hostname: status.softwarepublico.lappis | 7 | monitor_external_hostname: status.softwarepublico.lappis |
6 | external_ip: 10.0.0.54 | 8 | external_ip: 10.0.0.54 |
9 | +alt_ssh_port: 5555 | ||
7 | colab_from_address: '"Portal do Software Publico" <noreply@softwarepublico.lappis>' | 10 | colab_from_address: '"Portal do Software Publico" <noreply@softwarepublico.lappis>' |
8 | server_email: '"Portal do Software Publico" <noreply@softwarepublico.lappis>' | 11 | server_email: '"Portal do Software Publico" <noreply@softwarepublico.lappis>' |
9 | -email_subject_prefix: '[spb]' | 12 | +email_subject_prefix: '[spb|local]' |
10 | lists_hostname: listas.softwarepublico.lappis | 13 | lists_hostname: listas.softwarepublico.lappis |
11 | lists_admin: paulo@softwarelivre.org | 14 | lists_admin: paulo@softwarelivre.org |
12 | relay_hostname: relay.softwarepublico.lappis | 15 | relay_hostname: relay.softwarepublico.lappis |
13 | relay_ip: 10.0.0.51 | 16 | relay_ip: 10.0.0.51 |
14 | -alt_ssh_port: 5555 | ||
15 | from_address: noreply@softwarepublico.lappis | 17 | from_address: noreply@softwarepublico.lappis |
16 | -# define less frequent backup for dev envs | ||
17 | dev_backup_frequency: true | 18 | dev_backup_frequency: true |
18 | disable_send_emails: true | 19 | disable_send_emails: true |
config/local/config.yaml
1 | +rpm_repository: https://copr-be.cloud.fedoraproject.org/results/softwarepublico/v5/epel-7-$basearch/ | ||
2 | +rpm_gpgkey: https://copr-be.cloud.fedoraproject.org/results/softwarepublico/v5/pubkey.gpg | ||
1 | admins: | 3 | admins: |
2 | - ["Paulo Meirelles", "paulo@softwarelivre.org"] | 4 | - ["Paulo Meirelles", "paulo@softwarelivre.org"] |
3 | site_url: https://softwarepublico.dev | 5 | site_url: https://softwarepublico.dev |
@@ -8,6 +10,7 @@ alternative_hostnames: | @@ -8,6 +10,7 @@ alternative_hostnames: | ||
8 | - beta.softwarepublico.dev | 10 | - beta.softwarepublico.dev |
9 | - portal.softwarepublico.dev | 11 | - portal.softwarepublico.dev |
10 | external_ip: 10.10.10.6 | 12 | external_ip: 10.10.10.6 |
13 | +alt_ssh_port: 5555 | ||
11 | colab_from_address: '"Portal do Software Publico" <noreply@softwarepublico.dev>' | 14 | colab_from_address: '"Portal do Software Publico" <noreply@softwarepublico.dev>' |
12 | server_email: '"Portal do Software Publico" <noreply@softwarepublico.dev>' | 15 | server_email: '"Portal do Software Publico" <noreply@softwarepublico.dev>' |
13 | email_subject_prefix: '[spb]' | 16 | email_subject_prefix: '[spb]' |
@@ -15,7 +18,6 @@ lists_hostname: listas.softwarepublico.dev | @@ -15,7 +18,6 @@ lists_hostname: listas.softwarepublico.dev | ||
15 | lists_admin: paulo@softwarelivre.org | 18 | lists_admin: paulo@softwarelivre.org |
16 | relay_hostname: relay.softwarepublico.dev | 19 | relay_hostname: relay.softwarepublico.dev |
17 | relay_ip: 10.10.10.3 | 20 | relay_ip: 10.10.10.3 |
18 | -alt_ssh_port: 5555 | ||
19 | from_address: noreply@softwarepublico.dev | 21 | from_address: noreply@softwarepublico.dev |
20 | raven_dsn: https://a5e2f92a83774dfc9de66486e0fe970b:1a9229a4e1d2483582144d302fb53115@sentry.tracy.com.br/19 | 22 | raven_dsn: https://a5e2f92a83774dfc9de66486e0fe970b:1a9229a4e1d2483582144d302fb53115@sentry.tracy.com.br/19 |
21 | colab_http_workers: 1 | 23 | colab_http_workers: 1 |
cookbooks/basics/recipes/default.rb
@@ -65,7 +65,6 @@ package 'tmux' | @@ -65,7 +65,6 @@ package 'tmux' | ||
65 | package 'less' | 65 | package 'less' |
66 | package 'htop' | 66 | package 'htop' |
67 | package 'ntp' | 67 | package 'ntp' |
68 | -package 'screen' | ||
69 | 68 | ||
70 | cookbook_file '/usr/local/bin/is-a-container' do | 69 | cookbook_file '/usr/local/bin/is-a-container' do |
71 | owner 'root' | 70 | owner 'root' |
cookbooks/colab/recipes/default.rb
@@ -168,18 +168,15 @@ template '/etc/colab/plugins.d/spb.py' do | @@ -168,18 +168,15 @@ template '/etc/colab/plugins.d/spb.py' do | ||
168 | notifies :restart, 'service[colab]' | 168 | notifies :restart, 'service[colab]' |
169 | end | 169 | end |
170 | 170 | ||
171 | -template '/etc/colab/plugins.d/sentry_client.py' do | 171 | +template '/etc/colab/plugins.d/mezuro.py' do |
172 | owner 'root' | 172 | owner 'root' |
173 | group 'colab' | 173 | group 'colab' |
174 | mode 0640 | 174 | mode 0640 |
175 | notifies :restart, 'service[colab]' | 175 | notifies :restart, 'service[colab]' |
176 | end | 176 | end |
177 | 177 | ||
178 | -template '/etc/colab/plugins.d/mezuro.py' do | ||
179 | - owner 'root' | ||
180 | - group 'colab' | ||
181 | - mode 0640 | ||
182 | - notifies :restart, 'service[colab]' | 178 | +file '/etc/colab/plugins.d/sentry_client.py' do |
179 | + action :delete | ||
183 | end | 180 | end |
184 | 181 | ||
185 | execute 'colab-admin migrate' | 182 | execute 'colab-admin migrate' |
@@ -209,6 +206,14 @@ cookbook_file '/etc/colab/widgets.d/gitlab_profile.py' do | @@ -209,6 +206,14 @@ cookbook_file '/etc/colab/widgets.d/gitlab_profile.py' do | ||
209 | notifies :restart, 'service[colab]' | 206 | notifies :restart, 'service[colab]' |
210 | end | 207 | end |
211 | 208 | ||
209 | +cookbook_file '/etc/colab/widgets.d/noosfero_profile.py' do | ||
210 | + owner 'root' | ||
211 | + group 'colab' | ||
212 | + mode 0640 | ||
213 | + | ||
214 | + notifies :restart, 'service[colab]' | ||
215 | +end | ||
216 | + | ||
212 | # Static files | 217 | # Static files |
213 | directory '/var/lib/colab/assets/spb/' do | 218 | directory '/var/lib/colab/assets/spb/' do |
214 | owner 'root' | 219 | owner 'root' |
cookbooks/colab/templates/sentry_client.py.erb
cookbooks/gitlab/recipes/default.rb
@@ -120,9 +120,14 @@ execute 'change-gitlab-assets-owner' do | @@ -120,9 +120,14 @@ execute 'change-gitlab-assets-owner' do | ||
120 | only_if 'ls -l /var/lib/gitlab-assets | grep root' | 120 | only_if 'ls -l /var/lib/gitlab-assets | grep root' |
121 | end | 121 | end |
122 | 122 | ||
123 | +# TODO: the ignore_failure prevents the recipe to stop running when a exit non 0 happens | ||
124 | +# The precompile-assets runs into a bug that happens when it runs the FIRST time | ||
125 | +# This means that when runs into a new and clean machine it will crash | ||
126 | +# This bug is related to gitlab 7.6.* it should fix on gitlab 8.* | ||
123 | execute 'precompile-assets' do | 127 | execute 'precompile-assets' do |
124 | user 'git' | 128 | user 'git' |
125 | cwd '/usr/lib/gitlab' | 129 | cwd '/usr/lib/gitlab' |
130 | + ignore_failure true | ||
126 | command 'bundle exec rake assets:precompile RAILS_ENV=production' | 131 | command 'bundle exec rake assets:precompile RAILS_ENV=production' |
127 | action :nothing | 132 | action :nothing |
128 | end | 133 | end |
cookbooks/mezuro/recipes/kalibro_configurations.rb
1 | include_recipe 'mezuro::service' | 1 | include_recipe 'mezuro::service' |
2 | +include_recipe 'mezuro::repo' | ||
2 | 3 | ||
3 | -# TODO: remove before define main repo | ||
4 | -execute 'download:mezuro' do | ||
5 | - command 'wget https://bintray.com/mezurometrics/rpm/rpm -O bintray-mezurometrics-rpm.repo' | ||
6 | - cwd '/etc/yum.repos.d' | ||
7 | - user 'root' | 4 | +package 'kalibro-configurations' do |
5 | + action :upgrade | ||
8 | end | 6 | end |
9 | 7 | ||
10 | -package 'kalibro-configurations' | ||
11 | - | ||
12 | template '/etc/mezuro/kalibro-configurations/database.yml' do | 8 | template '/etc/mezuro/kalibro-configurations/database.yml' do |
13 | source 'kalibro_configurations/database.yml.erb' | 9 | source 'kalibro_configurations/database.yml.erb' |
14 | owner 'kalibro_configurations' | 10 | owner 'kalibro_configurations' |
cookbooks/mezuro/recipes/kalibro_processor.rb
1 | include_recipe 'mezuro::service' | 1 | include_recipe 'mezuro::service' |
2 | +include_recipe 'mezuro::repo' | ||
2 | 3 | ||
3 | -execute 'download:mezuro' do | ||
4 | - command 'wget https://bintray.com/mezurometrics/rpm/rpm -O bintray-mezurometrics-rpm.repo' | ||
5 | - cwd '/etc/yum.repos.d' | ||
6 | - user 'root' | 4 | +package 'kalibro-processor' do |
5 | + action :upgrade | ||
7 | end | 6 | end |
8 | 7 | ||
9 | -package 'kalibro-processor' | ||
10 | - | ||
11 | template '/etc/mezuro/kalibro-processor/database.yml' do | 8 | template '/etc/mezuro/kalibro-processor/database.yml' do |
12 | source 'kalibro_processor/database.yml.erb' | 9 | source 'kalibro_processor/database.yml.erb' |
13 | owner 'kalibro_processor' | 10 | owner 'kalibro_processor' |
cookbooks/mezuro/recipes/prezento.rb
1 | include_recipe 'mezuro::service' | 1 | include_recipe 'mezuro::service' |
2 | +include_recipe 'mezuro::repo' | ||
2 | 3 | ||
3 | -# change this to COPR repo when gets ready | ||
4 | -execute 'download:mezuro' do | ||
5 | - command 'wget https://bintray.com/mezurometrics/rpm/rpm -O bintray-mezurometrics-rpm.repo' | ||
6 | - cwd '/etc/yum.repos.d' | ||
7 | - user 'root' | 4 | +package 'prezento-spb' do |
5 | + action :upgrade | ||
8 | end | 6 | end |
9 | 7 | ||
10 | -package 'prezento-spb' | ||
11 | - | ||
12 | template '/etc/mezuro/prezento/database.yml' do | 8 | template '/etc/mezuro/prezento/database.yml' do |
13 | source 'prezento/database.yml.erb' | 9 | source 'prezento/database.yml.erb' |
14 | owner 'prezento' | 10 | owner 'prezento' |
cookbooks/rsyslog/recipes/default.rb
1 | -package 'rsyslog-mysql' do | ||
2 | - action [:install, :upgrade] | ||
3 | -end | ||
4 | package 'rsyslog' do | 1 | package 'rsyslog' do |
5 | action [:install, :upgrade] | 2 | action [:install, :upgrade] |
6 | end | 3 | end |
7 | 4 | ||
8 | -SPB_LOG='/var/log/spb.log' | ||
9 | - | ||
10 | -file SPB_LOG do | ||
11 | - owner 'root' | ||
12 | - group 'root' | ||
13 | - mode 0644 | ||
14 | -end | ||
15 | - | ||
16 | template "/etc/rsyslog.d/spb_log.conf" do | 5 | template "/etc/rsyslog.d/spb_log.conf" do |
17 | owner 'root' | 6 | owner 'root' |
18 | group 'root' | 7 | group 'root' |
@@ -24,12 +13,3 @@ service 'rsyslog' do | @@ -24,12 +13,3 @@ service 'rsyslog' do | ||
24 | action [:enable, :restart] | 13 | action [:enable, :restart] |
25 | end | 14 | end |
26 | 15 | ||
27 | -execute 'allowing-spb-log' do | ||
28 | - command 'semanage fcontext -a -t httpd_sys_rw_content_t '+SPB_LOG | ||
29 | - user 'root' | ||
30 | -end | ||
31 | - | ||
32 | -execute 'enable-spb-log' do | ||
33 | - command 'restorecon -v '+SPB_LOG | ||
34 | - user 'root' | ||
35 | -end |
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +package 'rsyslog-mysql' do | ||
2 | + action [:install, :upgrade] | ||
3 | +end | ||
4 | + | ||
5 | +SPB_LOG='/var/log/spb.log' | ||
6 | + | ||
7 | +file SPB_LOG do | ||
8 | + owner 'root' | ||
9 | + group 'root' | ||
10 | + mode 0644 | ||
11 | +end | ||
12 | + | ||
13 | +execute 'allowing-spb-log' do | ||
14 | + command 'semanage fcontext -a -t httpd_sys_rw_content_t ' + SPB_LOG | ||
15 | + user 'root' | ||
16 | +end | ||
17 | + | ||
18 | +execute 'enable-spb-log' do | ||
19 | + command 'restorecon -v ' + SPB_LOG | ||
20 | + user 'root' | ||
21 | +end |
roles/email_server.rb
roles/monitoring_server.rb
1 | name 'monitoring_server' | 1 | name 'monitoring_server' |
2 | description 'Monitoring server' | 2 | description 'Monitoring server' |
3 | -run_list 'recipe[munin]', 'recipe[rsyslog]', 'recipe[loganalyzer]' | 3 | +run_list *[ |
4 | + 'recipe[munin]', | ||
5 | + 'recipe[rsyslog]', | ||
6 | + 'recipe[rsyslog::server]', | ||
7 | + 'recipe[loganalyzer]' | ||
8 | +] |
roles/reverse_proxy_server.rb
1 | name 'database_server' | 1 | name 'database_server' |
2 | description 'Reverse proxy server' | 2 | description 'Reverse proxy server' |
3 | -run_list 'recipe[basics::nginx]', 'recipe[reverse_proxy]', 'recipe[reverse_proxy::mailman]', 'recipe[reverse_proxy::documentation]' | 3 | +run_list *[ |
4 | + 'recipe[basics::nginx]', | ||
5 | + 'recipe[reverse_proxy]', | ||
6 | + 'recipe[reverse_proxy::mailman]', | ||
7 | + 'recipe[reverse_proxy::documentation]' | ||
8 | +] |
roles/server.rb
1 | name 'server' | 1 | name 'server' |
2 | description 'Common configuration for all servers' | 2 | description 'Common configuration for all servers' |
3 | -run_list 'recipe[basics]', 'recipe[firewall]', 'recipe[email::client]', 'recipe[munin::node]', 'recipe[rsyslog]' | 3 | +run_list *[ |
4 | + 'recipe[basics]', | ||
5 | + 'recipe[firewall]', | ||
6 | + 'recipe[email::client]', | ||
7 | + 'recipe[munin::node]', | ||
8 | + 'recipe[rsyslog]' | ||
9 | +] |
-
mentioned in commit 021ddc87312cc6dad48e0772bfca45561a0cf006