capistrano-monit_runit 3.0.4 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e27269284e6f19230ddb34330f0ff8fcf9d2dd02
4
- data.tar.gz: 26242b79240ccdc9ce867e2556e51c82f3a93b58
3
+ metadata.gz: 0bcd6203961b40ae0cfa713bbc3105332cd2cb85
4
+ data.tar.gz: 9d6427177068ae51e113421e032a556588926da5
5
5
  SHA512:
6
- metadata.gz: a6908383a8a67b5c20973b87e86f2608aefccd2943ee3280a3c2e2626d8c4bfad71b8c9381f8f1b115f48b280272d74b6755aa79347899029af45353fb5fd047
7
- data.tar.gz: 1c869465901e70fcde02e3c29a9f63807dab042e9dd18e50eea8c650a8140ca6c02044bcbdc982e1b6fe6fb8a7005f2a7147783bc1e565fad302d9d8ef54cfb9
6
+ metadata.gz: 4aedb53a0a200122e3447408d00b915f388511d103fd102b14b258095cb4ca4b50fc90534dca94e3153ffbed329c24545216b7f91f1c0c1e5bd65e278ad30970
7
+ data.tar.gz: fefc7a15721f86db524240560e565f7ed42b181fb7d8409ff5b24fd21727d61dc3187cf7a5e283d9b1cc30b54a54890e320ee8b7d6f5e12276f080ad010b17d3
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
3
  gem 'capistrano', '~> 3.4'
4
- gem 'activesupport', '>= 3.0'
4
+ gem 'activesupport', '>= 4.0'
5
5
  group :development do
6
6
  gem 'bundler', '~> 1.7'
7
7
  gem 'jeweler', '~> 2.0'
data/Gemfile.lock CHANGED
@@ -72,7 +72,10 @@ PLATFORMS
72
72
  ruby
73
73
 
74
74
  DEPENDENCIES
75
- activesupport (>= 3.0)
75
+ activesupport (>= 4.0)
76
76
  bundler (~> 1.7)
77
77
  capistrano (~> 3.4)
78
78
  jeweler (~> 2.0)
79
+
80
+ BUNDLED WITH
81
+ 1.10.6
data/README.md CHANGED
@@ -30,14 +30,10 @@ require 'capistrano/runit'
30
30
 
31
31
  ## Sudoing
32
32
 
33
- The setup process requires sudo on some files and folders upon creation.
33
+ You should setup sudoers to allow control over monit and runit from the deployment user in either Salt, puppet, chef or
34
+ other form for infrastructure setup
34
35
 
35
- You should run the following commands to get the proper list for entries to be created in /etc/sudoers.d
36
-
37
- ```
38
- cap production runit:sudoers
39
- cap production monit:sudoers
40
- ```
36
+ The cap tasks for creating a sudoers list has been deprecated, as it does not belong to deployment of an app
41
37
 
42
38
  ## Services for Monit and Runit
43
39
 
@@ -143,4 +139,3 @@ The following variables must be set
143
139
  ## Copyright
144
140
 
145
141
  (c) 2013-2015 Leif Ringstad. See LICENSE.txt for details
146
-
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.4
1
+ 3.1.0
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: capistrano-monit_runit 3.0.4 ruby lib
5
+ # stub: capistrano-monit_runit 3.1.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "capistrano-monit_runit"
9
- s.version = "3.0.4"
9
+ s.version = "3.1.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Leif Ringstad"]
14
- s.date = "2015-08-13"
14
+ s.date = "2016-03-17"
15
15
  s.description = "Helpers for capistrano recipes using runit/monit."
16
16
  s.email = "leifcr@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -40,7 +40,6 @@ Gem::Specification.new do |s|
40
40
  "lib/capistrano/tasks/monit.rake",
41
41
  "lib/capistrano/tasks/runit.rake",
42
42
  "templates/monit/app_include.conf.erb",
43
- "templates/monit/monitrc.erb",
44
43
  "templates/runit/finish.erb",
45
44
  "templates/runit/log_run.erb",
46
45
  "templates/runit/run.erb"
@@ -55,18 +54,18 @@ Gem::Specification.new do |s|
55
54
 
56
55
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
57
56
  s.add_runtime_dependency(%q<capistrano>, ["~> 3.4"])
58
- s.add_runtime_dependency(%q<activesupport>, [">= 3.0"])
57
+ s.add_runtime_dependency(%q<activesupport>, [">= 4.0"])
59
58
  s.add_development_dependency(%q<bundler>, ["~> 1.7"])
60
59
  s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
61
60
  else
62
61
  s.add_dependency(%q<capistrano>, ["~> 3.4"])
63
- s.add_dependency(%q<activesupport>, [">= 3.0"])
62
+ s.add_dependency(%q<activesupport>, [">= 4.0"])
64
63
  s.add_dependency(%q<bundler>, ["~> 1.7"])
65
64
  s.add_dependency(%q<jeweler>, ["~> 2.0"])
66
65
  end
67
66
  else
68
67
  s.add_dependency(%q<capistrano>, ["~> 3.4"])
69
- s.add_dependency(%q<activesupport>, [">= 3.0"])
68
+ s.add_dependency(%q<activesupport>, [">= 4.0"])
70
69
  s.add_dependency(%q<bundler>, ["~> 1.7"])
71
70
  s.add_dependency(%q<jeweler>, ["~> 2.0"])
72
71
  end
@@ -4,10 +4,3 @@ namespace :load do
4
4
  set :sockets_path, proc { shared_path.join('sockets') }
5
5
  end
6
6
  end
7
-
8
- desc 'Get a list over Sudoers entries to add to a file in sudoers.d'
9
- task :sudoers do
10
- run_locally do
11
- info '--- Copy the information below into a a file in sudoers.d ---'
12
- end
13
- end
@@ -24,19 +24,6 @@ namespace :load do
24
24
  set :monit_enabled_path, proc { File.join(fetch(:monit_dir), 'enabled') }
25
25
  set :monit_application_group_name, proc { user_app_env_underscore }
26
26
 
27
- set :monit_mailserver, 'localhost'
28
- set :monit_mail_sender, 'monit@$HOST'
29
- set :monit_mail_reciever, nil # if this is nil, alerts are disabled
30
- set :monit_use_httpd, 'true'
31
- set :monit_httpd_bind_address, 'localhost'
32
- set :monit_httpd_allow_address, 'localhost'
33
- set :monit_httpd_signature, 'enable' # or enable
34
- set :monit_httpd_port, '2812'
35
-
36
- set :monit_daemon_time, '30'
37
- set :monit_start_delay, '30'
38
-
39
- set :monit_monitrc_template, File.join(File.expand_path(File.join(File.dirname(__FILE__), '../../../templates', 'monit')), 'monitrc.erb') # rubocop:disable Metrics/LineLength:
40
27
  set :monit_application_conf_template, File.join(File.expand_path(File.join(File.dirname(__FILE__), '../../../templates', 'monit')), 'app_include.conf.erb') # rubocop:disable Metrics/LineLength:
41
28
 
42
29
  set :monit_application_conf_file, proc { File.join(fetch(:monit_dir), 'monit.conf') }
@@ -46,29 +33,6 @@ namespace :load do
46
33
  end
47
34
 
48
35
  namespace :monit do
49
- desc 'Get the config needed to add to sudoers'
50
- task :sudoers do
51
- run_locally do
52
- puts '# -----------------------------------------------------------------------------------------'
53
- puts "# Sudo monit entries for #{fetch(:application)}"
54
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chmod 0700 #{monit_monitrc_file}"
55
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chmod 0775 #{monit_etc_path}"
56
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chmod 0700 #{monit_etc_path}"
57
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/mkdir -p #{monit_etc_conf_d_path}"
58
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chmod 6775 #{monit_etc_conf_d_path}"
59
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown #{fetch(:user)}\\:root #{monit_etc_path}"
60
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown #{fetch(:user)}\\:root #{monit_etc_conf_d_path}"
61
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown #{fetch(:user)}\\:root #{monit_monitrc_file}"
62
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown root\\:root #{monit_monitrc_file}"
63
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown deploy\\:deploy #{monit_monitrc_file}"
64
- puts "#{fetch(:user)} ALL=NOPASSWD: /usr/bin/monit *"
65
- puts "#{fetch(:user)} ALL=NOPASSWD: /usr/sbin/service monit *"
66
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/mkdir -p #{fetch(:monit_event_dir)}"
67
- puts '# -----------------------------------------------------------------------------------------'
68
- end
69
- # info "#{fetch(:user)} ALL=NOPASSWD: /bin/chown deploy:root #{monit_monitrc_file}"
70
- end
71
-
72
36
  desc 'Setup monit for the application'
73
37
  task :setup do
74
38
  on roles(:app) do |host|
@@ -83,42 +47,11 @@ namespace :monit do
83
47
  execute :mkdir, "-p #{fetch(:monit_enabled_path)}"
84
48
  end
85
49
 
86
- if test("[ ! -d #{monit_etc_conf_d_path} ]")
87
- execute :sudo, :mkdir, "-p #{monit_etc_conf_d_path}"
88
- end
89
- execute :sudo, :chmod, "6775 #{monit_etc_conf_d_path}"
90
- execute :sudo, :chown, "#{fetch(:user)}:root #{monit_etc_conf_d_path}"
91
-
92
50
  # Upload application global monit include file
93
51
  upload! template_to_s_io(fetch(:monit_application_conf_template)), fetch(:monit_application_conf_file)
94
52
  end
95
53
  end
96
54
 
97
- desc 'Setup main monit config file (/etc/monit/monitrc)'
98
- task :main_config do
99
- on roles(:app) do |host|
100
- set :createmonitrc, ask("Create #{monit_monitrc_file} [Y/n]", 'Y')
101
- if fetch(:createmonitrc) == 'Y'
102
- info "MONIT: Creating #{monit_monitrc_file} on #{host}"
103
- execute :sudo, :chown, "#{fetch(:user)}:root #{monit_etc_path}"
104
- execute :sudo, :chmod, "0775 #{monit_etc_path}"
105
- execute :sudo, :chown, "#{fetch(:user)}:root #{monit_monitrc_file}"
106
- if test("[ -e #{monit_monitrc_file} ]")
107
- execute :sudo, :chown, "deploy:deploy #{monit_monitrc_file}"
108
- execute :rm, "-f #{monit_monitrc_file}"
109
- end
110
-
111
- upload! template_to_s_io(fetch(:monit_monitrc_template)), monit_monitrc_file
112
- execute :sudo, :chmod, "0700 #{monit_monitrc_file}"
113
- execute :sudo, :chown, "root:root #{monit_monitrc_file}"
114
- execute :sudo, :service, 'monit restart'
115
- execute :sudo, :mkdir, "-p #{fetch(:monit_event_dir)}"
116
- info "MONIT: Sleeping for #{fetch(:monit_start_delay).to_i} seconds to wait for monit to be ready"
117
- sleep(fetch(:monit_start_delay).to_i)
118
- end
119
- end
120
- end
121
-
122
55
  desc 'Enable monit services for application'
123
56
  task :enable do
124
57
  on roles(:app) do |host|
@@ -225,21 +158,9 @@ namespace :monit do
225
158
  end
226
159
  end
227
160
 
228
- # after 'deploy:update', 'monit:enable'
229
- # after 'deploy:setup', 'monit:setup'
230
- before 'monit:setup', 'monit:main_config'
231
- # after 'monit:setup', 'monit:enable'
232
161
  after 'monit:enable', 'monit:reload'
233
162
 
234
- # This should be done in the app, as the sequence of restarting services can be specific
235
- # must trigger monitor after deploy
236
- # after 'deploy', 'monit:monitor'
237
- # must trigger unmonitor before deploy
238
- # before 'deploy', 'monit:unmonitor'
239
-
240
163
  before 'monit:disable', 'monit:unmonitor'
241
164
  after 'monit:disable', 'monit:reload'
242
165
 
243
166
  before 'monit:purge', 'monit:unmonitor'
244
-
245
- after 'sudoers', 'monit:sudoers'
@@ -32,27 +32,6 @@ namespace :load do
32
32
  end
33
33
 
34
34
  namespace :runit do
35
- desc 'Get the config needed to add to sudoers for all commands'
36
- task :sudoers do
37
- run_locally do
38
- puts '# -----------------------------------------------------------------------------------------'
39
- puts "# Sudo runit entries for #{fetch(:application)}"
40
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/mkdir -p #{runit_user_base_path}"
41
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown #{fetch(:user)}\\:root #{runit_user_base_path}"
42
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chmod 6775 #{runit_user_base_path}"
43
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/mkdir -p #{runit_etc_service_path}"
44
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown #{fetch(:user)}\\:root #{runit_etc_service_path}"
45
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chmod 6775 #{runit_etc_service_path}"
46
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/mkdir -p #{runit_var_log_service_path}"
47
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown #{fetch(:user)}\\:root #{runit_var_log_service_path}"
48
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown -R #{fetch(:user)}\\:#{fetch(:runit_log_group)} #{runit_var_log_service_path}" # rubocop:disable Metrics/LineLength:
49
- puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chmod 6775 #{runit_var_log_service_path}"
50
- puts "#{fetch(:user)} ALL=NOPASSWD: /usr/bin/sv *"
51
- puts '# -----------------------------------------------------------------------------------------'
52
- end
53
- # info "#{fetch(:user)} ALL=NOPASSWD: /bin/chown deploy:root #{monit_monitrc_file}"
54
- end
55
-
56
35
  desc 'Setup runit for the application'
57
36
  task :setup do
58
37
  on roles(:app) do |host|
@@ -70,15 +49,6 @@ namespace :runit do
70
49
  # '[INTERNAL] create /etc/sv folders and upload base templates needed'
71
50
  task :runit_create_app_services do
72
51
  on roles(:app) do |host|
73
- # set :pw, ask("Sudo password", '')
74
- # execute :echo, "#{fetch(:pw)} | sudo -S ls /"
75
- execute :sudo, :mkdir, "-p '#{runit_user_base_path}'" if test("[ ! -d '#{runit_user_base_path}' ]")
76
- execute :sudo, :chown, "#{fetch(:user)}:root '#{runit_user_base_path}'"
77
- execute :sudo, :chmod, "6775 '#{runit_user_base_path}'"
78
-
79
- execute :sudo, :mkdir, "-p '#{runit_etc_service_path}'" if test("[ ! -d '#{runit_etc_service_path}' ]")
80
- execute :sudo, :chown, "#{fetch(:user)}:root '#{runit_etc_service_path}'"
81
- execute :sudo, :chmod, "6775 '#{runit_etc_service_path}'"
82
52
  within("#{runit_user_base_path}") do
83
53
  execute :mkdir, "-p #{app_env_folder}"
84
54
  end
@@ -86,7 +56,6 @@ namespace :runit do
86
56
  upload! template_to_s_io(fetch(:runit_run_template)), runit_run_file
87
57
  upload! template_to_s_io(fetch(:runit_finish_template)), runit_finish_file
88
58
 
89
- # Should now work without sudo... ?
90
59
  execute :chmod, "0775 '#{runit_run_file}'"
91
60
  execute :chmod, "0775 '#{runit_finish_file}'"
92
61
  info "RUNIT: Created inital runit services in #{runit_base_path} for #{fetch(:application)} on #{host}"
@@ -100,11 +69,6 @@ namespace :runit do
100
69
  execute :mkdir, '-p log'
101
70
  end
102
71
  upload! template_to_s_io(fetch(:runit_log_run_template)), runit_log_run_file
103
- if test("[ ! -d #{runit_var_log_service_path} ]")
104
- execute :sudo, :mkdir, "-p '#{runit_var_log_service_path}'"
105
- execute :sudo, :chmod, "6775 '#{runit_var_log_service_path}'"
106
- execute :sudo, :chown, "-R #{fetch(:user)}:#{fetch(:runit_log_group)} '#{runit_var_log_service_path}'" # rubocop:disable Metrics/LineLength:
107
- end
108
72
  execute :mkdir, "-p #{runit_var_log_service_runit_path}" if test("[ ! -d #{runit_var_log_service_runit_path} ]")
109
73
  execute :chmod, "775 '#{runit_log_run_file}'"
110
74
 
@@ -171,4 +135,3 @@ after 'deploy:updated', 'runit:enable'
171
135
  after 'runit:setup', 'runit:setup:runit_create_app_services'
172
136
  after 'runit:setup:runit_create_app_services', 'runit:setup:runit_create_app_log_services'
173
137
  after 'runit:setup:runit_create_app_services', 'runit:setup:runit_ensure_shared_sockets_and_pids_folders'
174
- after 'sudoers', 'runit:sudoers'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-monit_runit
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leif Ringstad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-13 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: '4.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3.0'
40
+ version: '4.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -95,7 +95,6 @@ files:
95
95
  - lib/capistrano/tasks/monit.rake
96
96
  - lib/capistrano/tasks/runit.rake
97
97
  - templates/monit/app_include.conf.erb
98
- - templates/monit/monitrc.erb
99
98
  - templates/runit/finish.erb
100
99
  - templates/runit/log_run.erb
101
100
  - templates/runit/run.erb
@@ -1,23 +0,0 @@
1
- set daemon <%= fetch(:monit_daemon_time) %>
2
- with start delay <%= fetch(:monit_start_delay) %>
3
-
4
- set logfile syslog facility log_daemon
5
-
6
- set statefile /var/lib/monit/state
7
-
8
- set idfile /var/lib/monit/id
9
-
10
- set eventqueue
11
- basedir <%= fetch(:monit_event_dir) %> # set the base directory where events will be stored
12
- slots 100 # optionaly limit the queue size
13
-
14
- <%= fetch(:mail_alert_settings) %>
15
-
16
- <% unless fetch(:monit_use_httpd) == "false" %>
17
- set httpd port <%= fetch(:monit_httpd_port) %>
18
- <%= "use address #{fetch(:monit_httpd_bind_address, "localhost")}" unless fetch(:monit_httpd_bind_address).nil? %>
19
- <%= "allow #{fetch(:monit_httpd_allow_address)}" unless fetch(:monit_httpd_allow_address).nil? %>
20
- <%= "signature #{fetch(:monit_httpd_signature)}" %>
21
- <% end %>
22
-
23
- include /etc/monit/conf.d/*.conf