itamae-plugin-recipe-mackerel-agent 0.0.2 → 0.0.3

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
- SHA1:
3
- metadata.gz: 78c648f860e2aa4a33f542635c81e588f6bc40c5
4
- data.tar.gz: 478c6b3379733232105d516f96c7c6d4e27b7b2f
2
+ SHA256:
3
+ metadata.gz: 32b8878125789889b3ffcace544aa5e6c617e9c74d4166fc7b73a5ace6c6dae6
4
+ data.tar.gz: 2d624ace112e40ff87ac4920fc949e0f3926a907544ebc344a9aa332f7cd82ee
5
5
  SHA512:
6
- metadata.gz: 861fb92d9cfaf19d759b43a04e47de49ddfaca85b7572e158062c4031c5ec6853ed6607a068358112ba4c5a778afe809bbdd2e1224ab3487157c036a0adb0a6d
7
- data.tar.gz: 7112f81cab5bae099d8148f3348974181c141d9e58e4e893a94540f9f27076ec229c5170ad669a0cab6cd34eed0dbbecd4e378cb81cc20c7bba75c309947083c
6
+ metadata.gz: 281b369eebfd0e7fef9c080a21c3a28eaad3dc6dd49d0693edeb74bc6e4fa7254f7cf45e18a99a09f09853a369a8b5b5acc50ab36b2dee6b278bef5feccc20ca
7
+ data.tar.gz: 20e16bbce15e60455c2606155b91546845cbecdaff929556d23b1a85157f3043ae6e8fb6f32d1c29f9af397a519b82072a77aa506fd3e4419b52e0ce0c6fca91
data/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ mackerel-agent recipe CHANGELOG
2
+ =================================
3
+
4
+ This file is used to list changes made in each version of the mackerel-agent recipe.
5
+
6
+ v0.0.3
7
+ ------
8
+ - Support v2 packages #9 (by hayajo)
9
+ - New URL for GPG-KEY-mackerel #8 (by astj)
10
+ - Improve readme #7 (by shogo82148)
11
+
12
+ v0.0.2
13
+ ------
14
+ - Require node['mackerel-agent']['conf']['apikey'] attribute #6 (by unasuke)
15
+ - Set metadata gemspec.homepage to github repository #5 (by unasuke)
16
+
17
+ v0.0.1
18
+ ------
19
+ - Development release
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Itamae::Plugin::Recipe::Mackerel::Agent
2
2
 
3
- TODO: Write a gem description
3
+ [![Gem Version](https://badge.fury.io/rb/itamae-plugin-recipe-mackerel-agent.svg)](https://badge.fury.io/rb/itamae-plugin-recipe-mackerel-agent)
4
+
5
+ [Itamae](https://github.com/itamae-kitchen/itamae) recipe plugin for [mackerel-agent](https://github.com/mackerelio/mackerel-agent)
4
6
 
5
7
  ## Installation
6
8
 
@@ -20,11 +22,33 @@ Or install it yourself as:
20
22
 
21
23
  ## Usage
22
24
 
23
- TODO: Write usage instructions here
25
+ Load the recipe file in gems by `include_recipe`.
26
+
27
+ ```ruby
28
+ include_recipe "mackerel-agent"
29
+ ```
30
+
31
+ ## Attributes
32
+
33
+ ```ruby
34
+ # API key (REQUIRED)
35
+ node['mackerel-agent']['conf']['apikey'] = 'YOUR API KEY'
36
+
37
+ # Roles (optional)
38
+ node['mackerel-agent']['conf']['roles'] = ["My-Service:app", "Another-Service:db"]
39
+
40
+ # Install official plugins (optional)
41
+ node['plugins'] = ['mackerel-agent-plugins', 'mackerel-check-plugins']
42
+
43
+ # Enable plugins (optional)
44
+ node['mackerel-agent']['conf']['plugin.metrics.vmstat'] = {
45
+ 'command' => 'ruby /etc/sensu/plugins/system/vmstat-metrics.rb',
46
+ }
47
+ ```
24
48
 
25
49
  ## Contributing
26
50
 
27
- 1. Fork it ( https://github.com/[my-github-username]/itamae-plugin-recipe-mackerel-agent/fork )
51
+ 1. Fork it ( https://github.com/mackerelio/itamae-plugin-recipe-mackerel-agent/fork )
28
52
  2. Create your feature branch (`git checkout -b my-new-feature`)
29
53
  3. Commit your changes (`git commit -am 'Add some feature'`)
30
54
  4. Push to the branch (`git push origin my-new-feature`)
data/RELEASE.md ADDED
@@ -0,0 +1,10 @@
1
+ RELEASE
2
+ =======
3
+
4
+ 1. Create release branch. (`git checkout -b version-<VERSION>`)
5
+ 1. Bump version `lib/itamae/plugin/recipe/mackerel-agent/version.rb` file.
6
+ 1. Push release branch to upstream(GitHub). (`git push -u origin version-<VERSION>`)
7
+ 1. Create Pull-Request on Github.
8
+ 1. Merge Pull-Request to master branch on Github.
9
+ 1. Tagging and Release. (`rake release`)
10
+
@@ -7,24 +7,55 @@ node['mackerel-agent']['start_on_setup'] = node['mackerel-agent'].fetch('start_o
7
7
  node['mackerel-agent']['package-action'] = node['mackerel-agent'].fetch('package-action', :install)
8
8
  node['mackerel-agent']['plugins'] = node['mackerel-agent'].fetch('plugins', [])
9
9
 
10
+ def platform_version_satisfy?(op)
11
+ Gem::Requirement.create(op).satisfied_by?(Gem::Version.create(node[:platform_version]))
12
+ end
13
+
10
14
  case node[:platform]
11
15
  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 -"
16
+ if (node[:platform] == "debian" and platform_version_satisfy?('>= 8')) or (node[:platform] == "ubuntu" and platform_version_satisfy?('>= 16.04'))
17
+ execute "import mackerel GPG key v2" do
18
+ command "curl -fsSL https://mackerel.io/file/cert/GPG-KEY-mackerel-v2 | apt-key add -"
19
+ end
20
+ remote_file "/etc/apt/sources.list.d/mackerel.list" do
21
+ source "./files/etc/apt/sources.list.d/mackerel-v2.list"
22
+ end
23
+ else
24
+ execute "import mackerel GPG key" do
25
+ command "curl -fsSL https://mackerel.io/file/cert/GPG-KEY-mackerel | apt-key add -"
26
+ end
27
+ remote_file "/etc/apt/sources.list.d/mackerel.list"
15
28
  end
16
29
  execute "apt-get update -qq"
17
30
  when "redhat", "fedora"
18
- execute "import mackerel GPG key" do
19
- command "rpm --import https://mackerel.io/assets/files/GPG-KEY-mackerel"
31
+ if node[:platform] == "redhat" and platform_version_satisfy?('>= 7')
32
+ execute "import mackerel GPG key v2" do
33
+ command "rpm --import https://mackerel.io/file/cert/GPG-KEY-mackerel-v2"
34
+ end
35
+ remote_file "/etc/yum.repos.d/mackerel.repo" do
36
+ source "./files/etc/yum.repos.d/mackerel-v2.repo"
37
+ end
38
+ else
39
+ execute "import mackerel GPG key" do
40
+ command "rpm --import https://mackerel.io/file/cert/GPG-KEY-mackerel"
41
+ end
42
+ remote_file "/etc/yum.repos.d/mackerel.repo"
20
43
  end
21
- remote_file "/etc/yum.repos.d/mackerel.repo"
22
44
  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"
45
+ if platform_version_satisfy?('~> 2.0')
46
+ execute "import mackerel GPG key v2" do
47
+ command "rpm --import https://mackerel.io/file/cert/GPG-KEY-mackerel-v2"
48
+ end
49
+ remote_file "/etc/yum.repos.d/mackerel.repo" do
50
+ source "./files/etc/yum.repos.d/mackerel-amznlinux-v2.repo"
51
+ end
52
+ else
53
+ execute "import mackerel GPG key" do
54
+ command "rpm --import https://mackerel.io/file/cert/GPG-KEY-mackerel"
55
+ end
56
+ remote_file "/etc/yum.repos.d/mackerel.repo" do
57
+ source "./files/etc/yum.repos.d/mackerel-amznlinux.repo"
58
+ end
28
59
  end
29
60
  else
30
61
  raise "not supported this platform: " + node[:platform]
@@ -0,0 +1 @@
1
+ deb http://apt.mackerel.io/v2/ mackerel contrib
@@ -0,0 +1,5 @@
1
+ [mackerel]
2
+ name=mackerel-agent
3
+ baseurl=http://yum.mackerel.io/amznlinux/v2/$releasever/$basearch
4
+ gpgcheck=1
5
+ enabled=1
@@ -0,0 +1,5 @@
1
+ [mackerel]
2
+ name=mackerel-agent
3
+ baseurl=http://yum.mackerel.io/v2/$basearch
4
+ gpgcheck=1
5
+ enabled=1
@@ -3,7 +3,7 @@ module Itamae
3
3
  module Recipe
4
4
  module Mackerel
5
5
  module Agent
6
- VERSION = "0.0.2"
6
+ VERSION = "0.0.3"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-mackerel-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mackerel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-05 00:00:00.000000000 Z
11
+ date: 2018-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml
@@ -60,15 +60,20 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - CHANGELOG.md
63
64
  - Gemfile
64
65
  - LICENSE.txt
65
66
  - README.md
67
+ - RELEASE.md
66
68
  - Rakefile
67
69
  - itamae-plugin-recipe-mackerel-agent.gemspec
68
70
  - lib/itamae-plugin-recipe-mackerel-agent.rb
69
71
  - lib/itamae/plugin/recipe/mackerel-agent/default.rb
72
+ - lib/itamae/plugin/recipe/mackerel-agent/files/etc/apt/sources.list.d/mackerel-v2.list
70
73
  - lib/itamae/plugin/recipe/mackerel-agent/files/etc/apt/sources.list.d/mackerel.list
74
+ - lib/itamae/plugin/recipe/mackerel-agent/files/etc/yum.repos.d/mackerel-amznlinux-v2.repo
71
75
  - lib/itamae/plugin/recipe/mackerel-agent/files/etc/yum.repos.d/mackerel-amznlinux.repo
76
+ - lib/itamae/plugin/recipe/mackerel-agent/files/etc/yum.repos.d/mackerel-v2.repo
72
77
  - lib/itamae/plugin/recipe/mackerel-agent/files/etc/yum.repos.d/mackerel.repo
73
78
  - lib/itamae/plugin/recipe/mackerel-agent/version.rb
74
79
  homepage: https://github.com/mackerelio/itamae-plugin-recipe-mackerel-agent
@@ -91,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
96
  version: '0'
92
97
  requirements: []
93
98
  rubyforge_project:
94
- rubygems_version: 2.5.1
99
+ rubygems_version: 2.7.6
95
100
  signing_key:
96
101
  specification_version: 4
97
102
  summary: Itamae mackerel-agent recipe plugin