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 | 65 | node.data['firewall'] = firewall |
66 | 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 | 68 | task :console do |
75 | 69 | require 'pry' |
76 | 70 | binding.pry | ... | ... |
Vagrantfile
... | ... | @@ -61,7 +61,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
61 | 61 | end |
62 | 62 | end |
63 | 63 | |
64 | - config.vm.define 'reverseproxy', autostart: false do |reverseproxy| | |
64 | + config.vm.define 'reverseproxy' do |reverseproxy| | |
65 | 65 | reverseproxy.vm.provider "virtualbox" do |vm, override| |
66 | 66 | override.vm.network 'private_network', ip: ips['reverseproxy'] if ips |
67 | 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 | 3 | admins: |
2 | 4 | - ["Paulo Meirelles", "paulo@softwarelivre.org"] |
5 | +site_url: https://dev.softwarepublico.gov.br | |
3 | 6 | external_hostname: dev.softwarepublico.gov.br |
4 | 7 | monitor_external_hostname: status.dev.softwarepublico.gov.br |
5 | -external_ip: 189.9.151.16 | |
6 | 8 | alternative_hostnames: |
7 | 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 | 12 | colab_from_address: '"Portal do Software Publico (dev)" <noreply@dev.softwarepublico.gov.br>' |
10 | 13 | server_email: '"Portal do Software Publico (dev)" <noreply@dev.softwarepublico.gov.br>' |
11 | 14 | email_subject_prefix: '[spb|dev]' |
... | ... | @@ -15,9 +18,9 @@ from_address: noreply@dev.softwarepublico.gov.br |
15 | 18 | relay_hostname: relay.dev.softwarepublico.gov.br |
16 | 19 | relay_ip: 189.9.151.44 |
17 | 20 | external_outgoing_mail_relay: 189.9.150.53 |
18 | -alt_ssh_port: 55555 | |
19 | 21 | external_outgoing_mail_domain: serpro.gov.br |
20 | 22 | raven_dsn: https://a5e2f92a83774dfc9de66486e0fe970b:1a9229a4e1d2483582144d302fb53115@sentry.tracy.com.br/19 |
21 | 23 | google_analytics_id: 'UA-64206731-2' |
24 | +munin_master: 10.18.0.21 | |
22 | 25 | dev_backup_frequency: true |
23 | 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 | 3 | admins: |
2 | 4 | - ["Paulo Meirelles", "paulo@softwarelivre.org"] |
3 | 5 | site_url: https://softwarepublico.lappis |
4 | 6 | external_hostname: softwarepublico.lappis |
5 | 7 | monitor_external_hostname: status.softwarepublico.lappis |
6 | 8 | external_ip: 10.0.0.54 |
9 | +alt_ssh_port: 5555 | |
7 | 10 | colab_from_address: '"Portal do Software Publico" <noreply@softwarepublico.lappis>' |
8 | 11 | server_email: '"Portal do Software Publico" <noreply@softwarepublico.lappis>' |
9 | -email_subject_prefix: '[spb]' | |
12 | +email_subject_prefix: '[spb|local]' | |
10 | 13 | lists_hostname: listas.softwarepublico.lappis |
11 | 14 | lists_admin: paulo@softwarelivre.org |
12 | 15 | relay_hostname: relay.softwarepublico.lappis |
13 | 16 | relay_ip: 10.0.0.51 |
14 | -alt_ssh_port: 5555 | |
15 | 17 | from_address: noreply@softwarepublico.lappis |
16 | -# define less frequent backup for dev envs | |
17 | 18 | dev_backup_frequency: true |
18 | 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 | 3 | admins: |
2 | 4 | - ["Paulo Meirelles", "paulo@softwarelivre.org"] |
3 | 5 | site_url: https://softwarepublico.dev |
... | ... | @@ -8,6 +10,7 @@ alternative_hostnames: |
8 | 10 | - beta.softwarepublico.dev |
9 | 11 | - portal.softwarepublico.dev |
10 | 12 | external_ip: 10.10.10.6 |
13 | +alt_ssh_port: 5555 | |
11 | 14 | colab_from_address: '"Portal do Software Publico" <noreply@softwarepublico.dev>' |
12 | 15 | server_email: '"Portal do Software Publico" <noreply@softwarepublico.dev>' |
13 | 16 | email_subject_prefix: '[spb]' |
... | ... | @@ -15,7 +18,6 @@ lists_hostname: listas.softwarepublico.dev |
15 | 18 | lists_admin: paulo@softwarelivre.org |
16 | 19 | relay_hostname: relay.softwarepublico.dev |
17 | 20 | relay_ip: 10.10.10.3 |
18 | -alt_ssh_port: 5555 | |
19 | 21 | from_address: noreply@softwarepublico.dev |
20 | 22 | raven_dsn: https://a5e2f92a83774dfc9de66486e0fe970b:1a9229a4e1d2483582144d302fb53115@sentry.tracy.com.br/19 |
21 | 23 | colab_http_workers: 1 | ... | ... |
cookbooks/basics/recipes/default.rb
cookbooks/colab/recipes/default.rb
... | ... | @@ -168,18 +168,15 @@ template '/etc/colab/plugins.d/spb.py' do |
168 | 168 | notifies :restart, 'service[colab]' |
169 | 169 | end |
170 | 170 | |
171 | -template '/etc/colab/plugins.d/sentry_client.py' do | |
171 | +template '/etc/colab/plugins.d/mezuro.py' do | |
172 | 172 | owner 'root' |
173 | 173 | group 'colab' |
174 | 174 | mode 0640 |
175 | 175 | notifies :restart, 'service[colab]' |
176 | 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 | 180 | end |
184 | 181 | |
185 | 182 | execute 'colab-admin migrate' |
... | ... | @@ -209,6 +206,14 @@ cookbook_file '/etc/colab/widgets.d/gitlab_profile.py' do |
209 | 206 | notifies :restart, 'service[colab]' |
210 | 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 | 217 | # Static files |
213 | 218 | directory '/var/lib/colab/assets/spb/' do |
214 | 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 | 120 | only_if 'ls -l /var/lib/gitlab-assets | grep root' |
121 | 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 | 127 | execute 'precompile-assets' do |
124 | 128 | user 'git' |
125 | 129 | cwd '/usr/lib/gitlab' |
130 | + ignore_failure true | |
126 | 131 | command 'bundle exec rake assets:precompile RAILS_ENV=production' |
127 | 132 | action :nothing |
128 | 133 | end | ... | ... |
cookbooks/mezuro/recipes/kalibro_configurations.rb
1 | 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 | 6 | end |
9 | 7 | |
10 | -package 'kalibro-configurations' | |
11 | - | |
12 | 8 | template '/etc/mezuro/kalibro-configurations/database.yml' do |
13 | 9 | source 'kalibro_configurations/database.yml.erb' |
14 | 10 | owner 'kalibro_configurations' | ... | ... |
cookbooks/mezuro/recipes/kalibro_processor.rb
1 | 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 | 6 | end |
8 | 7 | |
9 | -package 'kalibro-processor' | |
10 | - | |
11 | 8 | template '/etc/mezuro/kalibro-processor/database.yml' do |
12 | 9 | source 'kalibro_processor/database.yml.erb' |
13 | 10 | owner 'kalibro_processor' | ... | ... |
cookbooks/mezuro/recipes/prezento.rb
1 | 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 | 6 | end |
9 | 7 | |
10 | -package 'prezento-spb' | |
11 | - | |
12 | 8 | template '/etc/mezuro/prezento/database.yml' do |
13 | 9 | source 'prezento/database.yml.erb' |
14 | 10 | owner 'prezento' | ... | ... |
cookbooks/rsyslog/recipes/default.rb
1 | -package 'rsyslog-mysql' do | |
2 | - action [:install, :upgrade] | |
3 | -end | |
4 | 1 | package 'rsyslog' do |
5 | 2 | action [:install, :upgrade] |
6 | 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 | 5 | template "/etc/rsyslog.d/spb_log.conf" do |
17 | 6 | owner 'root' |
18 | 7 | group 'root' |
... | ... | @@ -24,12 +13,3 @@ service 'rsyslog' do |
24 | 13 | action [:enable, :restart] |
25 | 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 @@ |
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
roles/reverse_proxy_server.rb
1 | 1 | name 'database_server' |
2 | 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 | 1 | name 'server' |
2 | 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