itamae-plugin-recipe-mackerel-agent 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 68804d9e8005a4c6aada0d0632256fbe1c0109bf
4
+ data.tar.gz: 1df41287bb9629b4b3fc36f2893ad454d80b1ddb
5
+ SHA512:
6
+ metadata.gz: 4dc03ca7a42b9f6c70b2d07da529297dec9a1a498ec2934513dbec6b589ff14a739c02c22e95095920f56c9b6a589d2955ceac3efd4b7a04cdfab7cd78e8ff40
7
+ data.tar.gz: 11ee00102846b2e032b86b9a0a5dcaab872595a82de08bdf5a3ed117d9a9aa716dc660d9b81893c4e8d68e7a8d8ec9b0e34d86ab7bcd25b64def42d3593ac981
@@ -0,0 +1,16 @@
1
+ .*
2
+ !.gitignore
3
+ /.bundle/
4
+ /.yardoc
5
+ /Gemfile.lock
6
+ /_yardoc/
7
+ /coverage/
8
+ /doc/
9
+ /pkg/
10
+ /spec/reports/
11
+ /tmp/
12
+ *.bundle
13
+ *.so
14
+ *.o
15
+ *.a
16
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in itamae-plugin-recipe-mackerel-agent.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Songmu
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,31 @@
1
+ # Itamae::Plugin::Recipe::Mackerel::Agent
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'itamae-plugin-recipe-mackerel-agent'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install itamae-plugin-recipe-mackerel-agent
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/itamae-plugin-recipe-mackerel-agent/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,25 @@
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/mackerel-agent/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "itamae-plugin-recipe-mackerel-agent"
8
+ spec.version = Itamae::Plugin::Recipe::Mackerel::Agent::VERSION
9
+ spec.authors = ["mackerel"]
10
+ spec.email = ["platform+mackerel@hatena.ne.jp"]
11
+ spec.summary = %q{Itamae mackerel-agent recipe plugin}
12
+ spec.description = %q{Itamae mackerel-agent recipe plugin}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "toml", "~> 0.1.2"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.7"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
@@ -0,0 +1 @@
1
+ require "itamae/plugin/recipe/mackerel-agent/default"
@@ -0,0 +1,61 @@
1
+ require "toml"
2
+
3
+ # set default attributes
4
+ node['mackerel-agent'] = {} unless node['mackerel-agent']
5
+ node['mackerel-agent']['conf'] = node['mackerel-agent'].fetch('conf', {})
6
+ node['mackerel-agent']['start_on_setup'] = node['mackerel-agent'].fetch('start_on_setup', true)
7
+ node['mackerel-agent']['package-action'] = node['mackerel-agent'].fetch('package-action', :install)
8
+ node['mackerel-agent']['plugins'] = node['mackerel-agent'].fetch('plugins', [])
9
+
10
+ case node[:platform]
11
+ when "debian", "ubuntu"
12
+ remote_file "/etc/apt/sources.list.d/mackerel.list"
13
+ execute "import mackerel GPG key" do
14
+ command "curl -fsS https://mackerel.io/assets/files/GPG-KEY-mackerel | apt-key add -"
15
+ end
16
+ execute "apt-get update -qq"
17
+ when "redhat", "fedora"
18
+ execute "import mackerel GPG key" do
19
+ command "rpm --import https://mackerel.io/assets/files/GPG-KEY-mackerel"
20
+ end
21
+ remote_file "/etc/yum.repos.d/mackerel.repo"
22
+ when "amazon"
23
+ execute "import mackerel GPG key" do
24
+ command "rpm --import https://mackerel.io/assets/files/GPG-KEY-mackerel"
25
+ end
26
+ remote_file "/etc/yum.repos.d/mackerel.repo" do
27
+ source "./files/etc/yum.repos.d/mackerel-amznlinux.repo"
28
+ end
29
+ else
30
+ raise "not supported this platform: " + node[:platform]
31
+ end
32
+
33
+ package "mackerel-agent" do
34
+ action node['mackerel-agent']['package-action'].to_sym
35
+ if node['mackerel-agent']['start_on_setup']
36
+ notifies :restart, "service[mackerel-agent]"
37
+ end
38
+ end
39
+
40
+ node['mackerel-agent']['plugins'].each do |plugin|
41
+ package plugin do
42
+ action :install
43
+ end
44
+ end
45
+
46
+ file "/etc/mackerel-agent/mackerel-agent.conf" do
47
+ owner "root"
48
+ group "root"
49
+ content TOML::Generator.new(node['mackerel-agent']['conf']).body
50
+ if node['mackerel-agent']['start_on_setup']
51
+ notifies :restart, "service[mackerel-agent]"
52
+ end
53
+ end
54
+
55
+ service "mackerel-agent" do
56
+ if node['mackerel-agent']['start_on_setup']
57
+ action [:enable, :start]
58
+ else
59
+ action :enable
60
+ end
61
+ end
@@ -0,0 +1 @@
1
+ deb http://apt.mackerel.io/debian/ mackerel contrib
@@ -0,0 +1,5 @@
1
+ [mackerel]
2
+ name=mackerel-agent
3
+ baseurl=http://yum.mackerel.io/amznlinux/$releasever/$basearch
4
+ gpgcheck=1
5
+ enabled=1
@@ -0,0 +1,5 @@
1
+ [mackerel]
2
+ name=mackerel-agent
3
+ baseurl=http://yum.mackerel.io/centos/$basearch
4
+ gpgcheck=1
5
+ enabled=1
@@ -0,0 +1,11 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module Mackerel
5
+ module Agent
6
+ VERSION = "0.0.1"
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-mackerel-agent
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - mackerel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: toml
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Itamae mackerel-agent recipe plugin
56
+ email:
57
+ - platform+mackerel@hatena.ne.jp
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - itamae-plugin-recipe-mackerel-agent.gemspec
68
+ - lib/itamae-plugin-recipe-mackerel-agent.rb
69
+ - lib/itamae/plugin/recipe/mackerel-agent/default.rb
70
+ - lib/itamae/plugin/recipe/mackerel-agent/files/etc/apt/sources.list.d/mackerel.list
71
+ - lib/itamae/plugin/recipe/mackerel-agent/files/etc/yum.repos.d/mackerel-amznlinux.repo
72
+ - lib/itamae/plugin/recipe/mackerel-agent/files/etc/yum.repos.d/mackerel.repo
73
+ - lib/itamae/plugin/recipe/mackerel-agent/version.rb
74
+ homepage: ''
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.2.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Itamae mackerel-agent recipe plugin
98
+ test_files: []