itamae-plugin-recipe-god 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbf17fdde771ef477f23338711cf3b00712f1e7f
4
- data.tar.gz: 933fa524561ae634f07972299ea360af77a1771e
3
+ metadata.gz: a930b01b32d4c5505827ce2c60bd4b806f6c052a
4
+ data.tar.gz: b5e5c9e76b403ad54ced1c1bd4fa7609663cf3dc
5
5
  SHA512:
6
- metadata.gz: 3e057f6b3b885540700e307ae88b63328ead4343c1b44653b6a2373f16fab7d001189a6e52612152806a69d0c93b71242d4136b3a7a4706b8e055aef1f51be26
7
- data.tar.gz: e10b8d085fbbfa044df5bc9d62be6ed2f05dc555f37eaddc8f68b979632e2a32a535944ae7ed455149453a15cf1eece68f0c1bf6607ca3399611a3c8c5bc819c
6
+ metadata.gz: 776d07bb42bff649c95a00252517d455219201cf7543afb847fed9ac8155a0ef9a55e5e5acecf881192d608c58db4f4f0d16ba497f6d5a2a6a7b10c22bffe342
7
+ data.tar.gz: e813326b65b471507024b181a0e5b8ec8b39bac154f24946fb1f6d9fa2b64165253daf79c6fe5f68bb4ea59fef6ab4b1eda9d87078a1ccffc7d4a768cf3c3c82
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Itamae::Plugin::Recipe::God
2
2
 
3
- itamae resource for god process monitoring framework
3
+ itamae recipe for god process monitoring framework
4
4
 
5
5
  ## Installation
6
6
 
@@ -20,7 +20,30 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ Include this recpie as:
24
+
25
+ include_recipe 'god'
26
+
27
+ This recipe will install god and generate the following files.
28
+
29
+ * /etc/god/master.conf
30
+
31
+ This is the master file for god configuration. It loads all cofiguration files with extension .god under the directory /etc/god/
32
+
33
+ * /etc/logrotate.d/god
34
+
35
+ god writes logfile to /var/log/god.log.
36
+ This recipe generages logrotation config file to rotate it on daily basis.
37
+
38
+ * /etc/init.d/god
39
+
40
+ service script for SysV init.
41
+ If the system does not use systemd such as CentOS6, configure for SysV init.
42
+
43
+ * /etc/systemd/system/god.service
44
+
45
+ Systemd Unit File.
46
+ If CentOS7, configure for systemd.
24
47
 
25
48
  ## Development
26
49
 
@@ -8,8 +8,9 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["y-matsuda"]
9
9
  spec.email = ["matsuda@lab.acs-jp.com"]
10
10
 
11
- spec.summary = %q{itamae resource for god process monitoring framework}
12
- spec.description = %q{itamae resource for god process monitoring framework}
11
+ spec.summary = %q{itamae recipe for god process monitoring framework}
12
+ spec.description = %q{itamae recipe for god process monitoring framework}
13
+ spec.homepage = "https://github.com/maedadev/itamae-plugin-recipe-god"
13
14
  spec.license = "MIT"
14
15
 
15
16
  # Specify which files should be added to the gem when it is released.
@@ -17,11 +17,31 @@ template '/etc/god/master.conf' do
17
17
  mode '644'
18
18
  end
19
19
 
20
- template '/etc/init.d/god' do
21
- user 'root'
22
- owner 'root'
23
- group 'root'
24
- mode '755'
20
+ service_variables = {
21
+ pid: '/var/run/god.pid',
22
+ config: '/etc/god/master.conf',
23
+ log: '/var/log/god.log',
24
+ log_level: 'info'
25
+ }
26
+
27
+ case "#{node.platform_family}-#{node.platform_version}"
28
+ when /rhel-7\.(.*?)/
29
+ which_god = run_command('which god')
30
+ template '/etc/systemd/system/god.service' do
31
+ user 'root'
32
+ owner 'root'
33
+ group 'root'
34
+ mode '755'
35
+ variables service_variables.merge({command: which_god.stdout.chomp})
36
+ end
37
+ else
38
+ template '/etc/init.d/god' do
39
+ user 'root'
40
+ owner 'root'
41
+ group 'root'
42
+ mode '755'
43
+ variables service_variables
44
+ end
25
45
  end
26
46
 
27
47
  template '/etc/logrotate.d/god' do
@@ -8,16 +8,16 @@
8
8
 
9
9
  . /etc/rc.d/init.d/functions
10
10
 
11
- PID=/var/run/god.pid
12
- CONFIG=/etc/god/master.conf
13
- LOG=/var/log/god.log
11
+ PID=<%= @pid %>
12
+ CONFIG=<%= @config %>
13
+ LOG=<%= @log %>
14
14
  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
15
15
  RETVAL=0
16
16
 
17
17
  case "$1" in
18
18
  start)
19
19
  echo -n 'Starting god: '
20
- god -P $PID -c $CONFIG -l $LOG --log-level info
20
+ god -P $PID -c $CONFIG -l $LOG --log-level <%= @log_level %>
21
21
  echo
22
22
  RETVAL=$?
23
23
  ;;
@@ -32,7 +32,7 @@ case "$1" in
32
32
  god quit
33
33
  echo
34
34
  echo -n 'Starting god: '
35
- god -P $PID -c $CONFIG -l $LOG --log-level info
35
+ god -P $PID -c $CONFIG -l $LOG --log-level <%= @log_level %>
36
36
  echo
37
37
  RETVAL=$?
38
38
  ;;
@@ -0,0 +1,11 @@
1
+ [Unit]
2
+ Description=God: A process monitoring framework in Ruby
3
+ After=network.target
4
+
5
+ [Service]
6
+ PIDFile=<%= @pid %>
7
+ ExecStart=<%= @command %> -c <%= @config %> -P <%= @pid %> -l <%= @log %> --log-level <%= @log_level %>
8
+ ExecStop=<%= @command %> quit
9
+
10
+ [Install]
11
+ WantedBy=multi-user.target
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module God
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-god
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - y-matsuda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-23 00:00:00.000000000 Z
11
+ date: 2019-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae
@@ -72,7 +72,7 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '10.0'
75
- description: itamae resource for god process monitoring framework
75
+ description: itamae recipe for god process monitoring framework
76
76
  email:
77
77
  - matsuda@lab.acs-jp.com
78
78
  executables: []
@@ -95,8 +95,9 @@ files:
95
95
  - lib/itamae/plugin/recipe/god/templates/etc/god/master.conf.erb
96
96
  - lib/itamae/plugin/recipe/god/templates/etc/init.d/god.erb
97
97
  - lib/itamae/plugin/recipe/god/templates/etc/logrotate.d/god.erb
98
+ - lib/itamae/plugin/recipe/god/templates/etc/systemd/system/god.service.erb
98
99
  - lib/itamae/plugin/recipe/god/version.rb
99
- homepage:
100
+ homepage: https://github.com/maedadev/itamae-plugin-recipe-god
100
101
  licenses:
101
102
  - MIT
102
103
  metadata: {}
@@ -119,5 +120,5 @@ rubyforge_project:
119
120
  rubygems_version: 2.5.2.3
120
121
  signing_key:
121
122
  specification_version: 4
122
- summary: itamae resource for god process monitoring framework
123
+ summary: itamae recipe for god process monitoring framework
123
124
  test_files: []