itamae-plugin-recipe-datadog 0.1.0 → 0.2.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
- SHA1:
3
- metadata.gz: 9ef9a99a2c6b9a9fee9f47a5c72d47e52f776dfa
4
- data.tar.gz: 4fd840dd4200d60c93c2549efb108584080bd39d
2
+ SHA256:
3
+ metadata.gz: 0ae9b400e6f30b6f5fe507b7e385474e31e9293c8b6d7336b2e464cd3d2cf0f7
4
+ data.tar.gz: 30e35ccecb871ea1b32d03879d8e4074ac2dc44a97095d9f2b7af1d6db0de3b1
5
5
  SHA512:
6
- metadata.gz: dcee3fbd297421fce4f9774448b00c6200840ccc1a90075618fbd08e23c72bb6c8bc0d10e971f49f4d4611af08eb0a9d2ca06d0700f59d46b23762439330d7e0
7
- data.tar.gz: d7f0eb182ec47503ff790fe33470f9c25da3dc05a70c496091d4b1e51d93cc7b0a30ea99a25b51abaa3d1156237b129737aa8115b5de5981de7dabe200b68147
6
+ metadata.gz: bd1e76a1884865d23d5617bab9759db252928649bed56afb928a3b59a785c95a853fb6c513ebf7e5e7d43c667f5993ebe126682981c0fbf1e09d0d809269eb7a
7
+ data.tar.gz: fa74c66777b61efdeeba897ba78f89860b4ac9dbb844e1c7c12991ab705af912620877493d8ed1999d7fb5351aa989a80e82545675cd26034d7e4e690a8827f4
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 takanamito
3
+ Copyright (c) 2016 takanamito and Speee, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -34,14 +34,19 @@ include_recipe "datadog::install"
34
34
  datadog:
35
35
  api_key: xxxxxx
36
36
  install_only: false # default: true
37
+ upgrade: true # default: false
37
38
  ```
38
39
 
39
- `node[:datadog][:api_key]` is your datadog-agent API Key.
40
- `node[:datadog][:install_only]` is an install option. If you want to install agent and don't start agent, please set this option`true`.
40
+ - `node[:datadog][:api_key]`
41
+ - Your datadog-agent API Key.
42
+ - `node[:datadog][:install_only]`
43
+ - An install option. If you want to install agent and don't start agent, please set this option`true`.
44
+ - `node[:datadog][:upgrade]`
45
+ - An install option. Upgrade datadog-agent version automatically.
41
46
 
42
47
  ## Contributing
43
48
 
44
- Bug reports and pull requests are welcome on GitHub at https://github.com/takanamito/itamae-plugin-recipe-datadog. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
49
+ Bug reports and pull requests are welcome on GitHub at https://github.com/speee/itamae-plugin-recipe-datadog. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
45
50
 
46
51
 
47
52
  ## License
@@ -6,12 +6,12 @@ require 'itamae/plugin/recipe/datadog/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "itamae-plugin-recipe-datadog"
8
8
  spec.version = Itamae::Plugin::Recipe::Datadog::VERSION
9
- spec.authors = ["Takahiro Kiso (takanamito)"]
9
+ spec.authors = ["Takahiro Kiso (takanamito)", "Speee, Inc."]
10
10
  spec.email = ["t.kiso0928@gmail.com"]
11
11
 
12
12
  spec.summary = %q{Itamae plugin to install datadog-agent.}
13
13
  spec.description = %q{Itamae plugin to install datadog-agent.}
14
- spec.homepage = "https://github.com/takanamito/itamae-plugin-recipe-datadog"
14
+ spec.homepage = "https://github.com/speee/itamae-plugin-recipe-datadog"
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -1,21 +1,36 @@
1
1
  node.reverse_merge!(
2
2
  datadog: {
3
- install_only: true
3
+ install_only: true,
4
+ upgrade: false,
4
5
  }
5
6
  )
6
7
 
7
8
  execute 'download install script' do
8
- command 'wget https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/install_agent.sh'
9
+ command 'wget https://raw.githubusercontent.com/DataDog/datadog-agent/main/cmd/agent/install_script.sh -O /tmp/install_script.sh'
10
+
11
+ # If upgrade is enabled, always download the latest install_script.sh
12
+ # If upgrade is disabled, download only when `/tmp/install_script.sh` doesn't exist
13
+ unless node[:datadog][:upgrade]
14
+ not_if 'ls /tmp/install_script.sh'
15
+ end
9
16
  end
10
17
 
11
- execute "change install script's permission" do
12
- command 'chmod 755 install_agent.sh'
18
+ file '/tmp/install_script.sh' do
19
+ action :edit
20
+ mode '0755'
13
21
  end
14
22
 
15
23
  execute 'install datadog-agent' do
16
- if node[:datadog][:install_only]
17
- command "DD_API_KEY=#{node[:datadog][:api_key]} DD_INSTALL_ONLY=true ./install_agent.sh"
18
- else
19
- command "DD_API_KEY=#{node[:datadog][:api_key]} ./install_agent.sh"
24
+ options = {}
25
+ options['DD_API_KEY'] = node[:datadog][:api_key]
26
+ options['DD_INSTALL_ONLY'] = 'true' if node[:datadog][:install_only]
27
+ options['DD_UPGRADE'] = 'true' if node[:datadog][:upgrade]
28
+ option_str = options.map { |k, v| "#{k}=#{v}" }.join(' ')
29
+ command "#{option_str} /tmp/install_script.sh"
30
+
31
+ # If upgrade is enabled, always run `install_script.sh`
32
+ # If upgrade is disabled, run `install_script.sh` only when datadog isn't installed
33
+ unless node[:datadog][:upgrade]
34
+ not_if 'ls /etc/datadog-agent/datadog.yaml'
20
35
  end
21
36
  end
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Datadog
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-datadog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiro Kiso (takanamito)
8
+ - Speee, Inc.
8
9
  autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2016-12-28 00:00:00.000000000 Z
12
+ date: 2022-03-19 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
@@ -71,7 +72,7 @@ files:
71
72
  - lib/itamae/plugin/recipe/datadog.rb
72
73
  - lib/itamae/plugin/recipe/datadog/install.rb
73
74
  - lib/itamae/plugin/recipe/datadog/version.rb
74
- homepage: https://github.com/takanamito/itamae-plugin-recipe-datadog
75
+ homepage: https://github.com/speee/itamae-plugin-recipe-datadog
75
76
  licenses:
76
77
  - MIT
77
78
  metadata: {}
@@ -90,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
91
  - !ruby/object:Gem::Version
91
92
  version: '0'
92
93
  requirements: []
93
- rubyforge_project:
94
- rubygems_version: 2.6.8
94
+ rubygems_version: 3.0.3.1
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Itamae plugin to install datadog-agent.