itamae-plugin-recipe-munin 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 05b7e86dd49a3f7980fe0f47937c80266afbbf0f
4
+ data.tar.gz: 6207e5450ded365dd5590bedf92b6edb430e39ff
5
+ SHA512:
6
+ metadata.gz: 8f80252bbb275835f5c2a566226f7c3ff217e2d8e0053802094e4f5d2f7c22dba11ee093d0e6cb211604bfc6922474071a1669b5cc4385cb57c89533596a1e98
7
+ data.tar.gz: 71286be7bda441fd89bbcad793405222b64ee3f6279365bfdb7e79bdd748156b151f7c5d3bc3e19d884b879085b4a18e06c04dc14141bc97c44b74407aa1ac87
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in itamae-plugin-recipe-munin.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 pataiji
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # Itamae::Plugin::Recipe::Munin
2
+
3
+ Itamae plugin to install munin-master and munin-node
4
+
5
+ ## Installation
6
+
7
+ Add this line to your itamae's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'itamae-plugin-recipe-munin'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ ## Usage
18
+
19
+ ### munin-master
20
+
21
+ Install munin-master (This recipe does not implement yet.)
22
+
23
+ #### Recipe
24
+
25
+ ```ruby
26
+ # your recipe
27
+ include_recipe 'munin::master'
28
+ ```
29
+
30
+ #### Node
31
+
32
+ Use this with `itamae -y node.yml`
33
+
34
+ ```yaml
35
+ # node.yml
36
+ munin:
37
+ master:
38
+ # TODO
39
+ ```
40
+
41
+ ### munin-node
42
+
43
+ Install munin-node
44
+
45
+ #### Recipe
46
+
47
+ ```ruby
48
+ # your recipe
49
+ include_recipe 'munin::node'
50
+ ```
51
+
52
+ #### Node
53
+
54
+ Use this with `itamae -y node.yml`
55
+
56
+ ref.) [official document](http://guide.munin-monitoring.org/en/latest/reference/munin-node.conf.html)
57
+
58
+ ```yaml
59
+ # node.yml
60
+ munin:
61
+ node:
62
+ host_name: example-host
63
+ allows:
64
+ - 10.0.0.10
65
+ - 10.0.0.11
66
+ ignore_files:
67
+ - ^README$
68
+ log_level: 4
69
+ log_file: /var/log/munin-node/munin-node.log
70
+ port: 4949
71
+ pid_file: /var/run/munin/munin-node.pid
72
+ background: 1
73
+ host: '*'
74
+ user: root
75
+ group: root
76
+ setsid: 1
77
+ timeout: 1
78
+ global_timeout: 15
79
+ ```
80
+
81
+ #### Notice
82
+
83
+ If you enabled SELinux, munin-node may not be able to start.
84
+
85
+ ## License
86
+
87
+ MIT
88
+
89
+ ## Contributing
90
+
91
+ Bug reports and pull requests are welcome on GitHub at https://github.com/pataiji/itamae-plugin-recipe-munin.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'itamae/plugin/recipe/munin/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'itamae-plugin-recipe-munin'
8
+ spec.version = Itamae::Plugin::Recipe::Munin::VERSION
9
+ spec.authors = ['pataiji']
10
+ spec.email = ['pataiji@gmail.com']
11
+
12
+ spec.summary = 'Itamae plugin to install munin'
13
+ spec.description = 'Itamae plugin to install munin'
14
+ spec.homepage = 'https://github.com/pataiji/itamae-plugin-recipe-munin'
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_development_dependency 'bundler', '~> 1.12'
21
+ spec.add_development_dependency 'rake', '~> 10.0'
22
+ end
@@ -0,0 +1,10 @@
1
+ require 'itamae/plugin/recipe/munin/version'
2
+
3
+ module Itamae
4
+ module Plugin
5
+ module Recipe
6
+ module Munin
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ epel_installed = run_command(
2
+ 'test -n "$(yum list installed | grep epel-release)"',
3
+ error: false
4
+ ).success?
5
+
6
+ package 'epel-release'
7
+
8
+ file '/etc/yum.repos.d/epel.repo' do
9
+ action :edit
10
+ block do |content|
11
+ content.sub!('enabled=1', 'enabled=0')
12
+ end
13
+ not_if epel_installed
14
+ end
@@ -0,0 +1,13 @@
1
+ include_recipe 'munin::dependency'
2
+
3
+ node.validate! do
4
+ { munin: { master: {} } }
5
+ end
6
+
7
+ # TODO: implement logics to install munin-master
8
+
9
+ # config = YAML.load_file(File.join(__dir__, 'master.yml'))
10
+
11
+ # service 'munin' do
12
+ # action [:enable, :start]
13
+ # end
File without changes
@@ -0,0 +1,23 @@
1
+ include_recipe 'munin::dependency'
2
+
3
+ node.validate! do
4
+ { munin: { node: {} } }
5
+ end
6
+
7
+ package 'munin-node' do
8
+ options '--enablerepo=epel'
9
+ end
10
+
11
+ config = YAML.load_file(File.join(__dir__, 'node.yml'))
12
+
13
+ template '/etc/munin/munin-node.conf' do
14
+ owner 'root'
15
+ group 'root'
16
+ mode '644'
17
+ variables(config: config.merge(node[:munin][:node]))
18
+ notifies :restart, 'service[munin-node]'
19
+ end
20
+
21
+ service 'munin-node' do
22
+ action [:enable, :start]
23
+ end
@@ -0,0 +1,11 @@
1
+ log_level: 4
2
+ log_file: /var/log/munin-node/munin-node.log
3
+ port: 4949
4
+ pid_file: /var/run/munin/munin-node.pid
5
+ background: 1
6
+ host: '*'
7
+ user: root
8
+ group: root
9
+ setsid: 1
10
+ timeout: 1
11
+ global_timeout: 15
@@ -0,0 +1,71 @@
1
+ #
2
+ # Example config-file for munin-node
3
+ #
4
+
5
+ log_level <%= @config[:log_level] %>
6
+ log_file <%= @config[:log_file] %>
7
+ pid_file <%= @config[:pid_file] %>
8
+
9
+ background <%= @config[:background] %>
10
+ setsid <%= @config[:setsid] %>
11
+
12
+ user <%= @config[:user] %>
13
+ group <%= @config[:group] %>
14
+
15
+ # This is the timeout for the whole transaction.
16
+ # Units are in sec. Default is 15 min
17
+ #
18
+ global_timeout <%= @config[:global_timeout] %>
19
+
20
+ # This is the timeout for each plugin.
21
+ # Units are in sec. Default is 1 min
22
+ #
23
+ timeout <%= @config[:timeout] %>
24
+
25
+ # Regexps for files to ignore
26
+ ignore_file [\#~]$
27
+ ignore_file DEADJOE$
28
+ ignore_file \.bak$
29
+ ignore_file %$
30
+ ignore_file \.dpkg-(tmp|new|old|dist)$
31
+ ignore_file \.rpm(save|new)$
32
+ ignore_file \.pod$
33
+ <% @config.fetch(:ignore_files, []).each do |ignore_file| %>
34
+ ignore_file <%= ignore_file %>
35
+ <% end %>
36
+
37
+ # Set this if the client doesn't report the correct hostname when
38
+ # telnetting to localhost, port 4949
39
+ #
40
+ <% if @config[:host_name] %>
41
+ host_name <%= @config[:host_name] %>
42
+ <% end %>
43
+
44
+ # A list of addresses that are allowed to connect. This must be a
45
+ # regular expression, since Net::Server does not understand CIDR-style
46
+ # network notation unless the perl module Net::CIDR is installed. You
47
+ # may repeat the allow line as many times as you'd like
48
+
49
+ allow ^127\.0\.0\.1$
50
+ allow ^::1$
51
+ <% @config.fetch(:allows, []).each do |allow| %>
52
+ allow <%= allow %>
53
+ <% end %>
54
+
55
+ # If you have installed the Net::CIDR perl module, you can use one or more
56
+ # cidr_allow and cidr_deny address/mask patterns. A connecting client must
57
+ # match any cidr_allow, and not match any cidr_deny. Note that a netmask
58
+ # *must* be provided, even if it's /32
59
+ #
60
+ # Example:
61
+ #
62
+ # cidr_allow 127.0.0.1/32
63
+ # cidr_allow 192.0.2.0/24
64
+ # cidr_deny 192.0.2.42/32
65
+
66
+ # Which address to bind to;
67
+ host <%= @config[:host] %>
68
+ # host 127.0.0.1
69
+
70
+ # And which port
71
+ port <%= @config[:port] %>
@@ -0,0 +1,9 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module Munin
5
+ VERSION = '0.1.0'.freeze
6
+ end
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-munin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - pataiji
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Itamae plugin to install munin
42
+ email:
43
+ - pataiji@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - itamae-plugin-recipe-munin.gemspec
54
+ - lib/itamae/plugin/recipe/munin.rb
55
+ - lib/itamae/plugin/recipe/munin/dependency.rb
56
+ - lib/itamae/plugin/recipe/munin/master.rb
57
+ - lib/itamae/plugin/recipe/munin/master.yml
58
+ - lib/itamae/plugin/recipe/munin/node.rb
59
+ - lib/itamae/plugin/recipe/munin/node.yml
60
+ - lib/itamae/plugin/recipe/munin/templates/etc/munin/munin-node.conf.erb
61
+ - lib/itamae/plugin/recipe/munin/version.rb
62
+ homepage: https://github.com/pataiji/itamae-plugin-recipe-munin
63
+ licenses:
64
+ - MIT
65
+ metadata: {}
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 2.5.1
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Itamae plugin to install munin
86
+ test_files: []