itamae-plugin-recipe-datadog 0.2.2 → 0.3.0

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
  SHA256:
3
- metadata.gz: 102c6593fcfa07616474fea986ab3cea337bb9fc4778983f70282bb465dbbb31
4
- data.tar.gz: 3a80383142aad9bd528958903c9676b3e6f901eb264bb9ef70e95944427978e9
3
+ metadata.gz: 270aa0439537a833f4a965cfbe7408436ee6ded43ba9672e19796e8a4f5bae24
4
+ data.tar.gz: 22652f8ec2046564635eae3986a168b1457746e848d62aaf28f2e304a124ed7c
5
5
  SHA512:
6
- metadata.gz: f23f1ebf2d583646765abca4a96085bf655b9a98066d65e57b83690efc2d893440d73b43730f937e897bf6709424523b0e782f657ed2032ea31ea6efc1745b6f
7
- data.tar.gz: 33a7ea4f01b0d756dfe626319c18ad2ca084f03a7738d95f237f82dbac684cce27ec5b5a620925a04e767d55a13bf6d4b221decce2fa3b33181f39674be91025
6
+ metadata.gz: '048258f6743632da7b2f03c1f49b864663481e10bed25d50afe7acd87d230c18706e4ce915777ef0d0710907faae58f7b7b4148d9b666efed02a114c0136ce72'
7
+ data.tar.gz: 2c68f7f58e89053240926b461e2f5a110c87ae86e955d4efa66371b2c420d47253d09866bcce863f83ee82f59857d477d57391c386572bfdaf02282fa8878c83
@@ -25,6 +25,7 @@ jobs:
25
25
  image:
26
26
  - debian:buster
27
27
  - amazonlinux:2
28
+ - ubuntu:focal
28
29
 
29
30
  steps:
30
31
  - uses: actions/checkout@v2
@@ -70,6 +71,12 @@ jobs:
70
71
  DATADOG_UPGRADE: "true"
71
72
  DD_API_KEY: api_key_3
72
73
 
74
+ - name: Run test (DD_AGENT_MAJOR_VERSION is specified)
75
+ run: bundle exec rake test
76
+ env:
77
+ IMAGE: ${{ matrix.image }}
78
+ DD_AGENT_MAJOR_VERSION: 7
79
+
73
80
  - name: Slack Notification (not success)
74
81
  uses: lazy-actions/slatify@master
75
82
  if: "! success()"
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## Unreleased
2
- [full changelog](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/compare/v0.2.2...master)
2
+ [full changelog](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/compare/v0.3.0...master)
3
+
4
+ ## v0.3.0
5
+ [full changelog](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/compare/v0.2.2...v0.3.0)
6
+
7
+ * Add `node[:datadog][:agent_major_version]`
8
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/22
9
+ * Add `node[:datadog][:integrations]` and `install_datadog_agent_integration`
10
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/23
11
+ * Support Ubuntu Focal
12
+ * https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/pull/24
3
13
 
4
14
  ## v0.2.2
5
15
  [full changelog](https://github.com/itamae-plugins/itamae-plugin-recipe-datadog/compare/v0.2.1...v0.2.2)
data/README.md CHANGED
@@ -38,6 +38,11 @@ datadog:
38
38
  api_key: xxxxxx
39
39
  install_only: false # default: true
40
40
  upgrade: true # default: false
41
+ agent_major_version: 7 # default: none
42
+
43
+ integrations: # default: {}
44
+ datadog-puma: 1.1.0 # Install specified version (recommended)
45
+ datadog-vsphere: # Install latest version
41
46
  ```
42
47
 
43
48
  - `node[:datadog][:api_key]`
@@ -46,6 +51,33 @@ datadog:
46
51
  - An install option. If you want to install agent and don't start agent, please set this option`true`.
47
52
  - `node[:datadog][:upgrade]`
48
53
  - An install option. Upgrade datadog-agent version automatically.
54
+ - `node[:datadog][:agent_major_version]`
55
+ - Whether to install any major version of the agent. (e.g. `7`)
56
+ - default is none. installed with datadog-agent v6
57
+ - see https://docs.datadoghq.com/agent/versions/upgrade_to_agent_v7
58
+ - `node[:datadog][:integrations]`
59
+ - Install integrations
60
+ - see https://docs.datadoghq.com/agent/guide/integration-management/
61
+ - key: integration name (e.g. `datadog-puma`)
62
+ - value: integration version (e.g. `1.1.0`)
63
+
64
+ ## Definitions
65
+ ### install_datadog_agent_integration
66
+ Install datadog-agent integration
67
+
68
+ Usage
69
+
70
+ ```ruby
71
+ include_recipe "datadog::install_datadog_agent_integration"
72
+
73
+ # Install specified version (recommended)
74
+ install_datadog_agent_integration "datadog-puma" do
75
+ version "1.1.0"
76
+ end
77
+
78
+ # Install latest version
79
+ install_datadog_agent_integration "datadog-puma"
80
+ ```
49
81
 
50
82
  ## Contributing
51
83
 
@@ -1,7 +1,10 @@
1
+ include_recipe "datadog::install_datadog_agent_integration"
2
+
1
3
  node.reverse_merge!(
2
4
  datadog: {
3
5
  install_only: true,
4
6
  upgrade: false,
7
+ integration: {},
5
8
  }
6
9
  )
7
10
 
@@ -27,6 +30,7 @@ execute 'install datadog-agent' do
27
30
  options['DD_API_KEY'] = node[:datadog][:api_key]
28
31
  options['DD_INSTALL_ONLY'] = 'true' if node[:datadog][:install_only]
29
32
  options['DD_UPGRADE'] = 'true' if node[:datadog][:upgrade]
33
+ options['DD_AGENT_MAJOR_VERSION'] = node[:datadog][:agent_major_version] if node[:datadog][:agent_major_version]
30
34
  option_str = options.map { |k, v| "#{k}=#{v}" }.join(' ')
31
35
  command "#{option_str} /tmp/install_script.sh"
32
36
 
@@ -36,3 +40,9 @@ execute 'install datadog-agent' do
36
40
  not_if 'ls /etc/datadog-agent/datadog.yaml'
37
41
  end
38
42
  end
43
+
44
+ node[:datadog][:integrations].each do |integration_name, integration_version|
45
+ install_datadog_agent_integration integration_name do
46
+ version integration_version
47
+ end
48
+ end
@@ -0,0 +1,14 @@
1
+ define :install_datadog_agent_integration, version: nil do
2
+ version = params[:version]
3
+ name = params[:name]
4
+
5
+ if version
6
+ execute "datadog-agent integration install -t #{name}==#{version} --allow-root" do
7
+ not_if "datadog-agent integration show #{name} | grep #{version}"
8
+ end
9
+ else
10
+ execute "datadog-agent integration install -t #{name} --allow-root" do
11
+ not_if "datadog-agent integration show #{name}"
12
+ end
13
+ end
14
+ end
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Datadog
5
- VERSION = "0.2.2"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-datadog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiro Kiso (takanamito)
@@ -118,6 +118,7 @@ files:
118
118
  - itamae-plugin-recipe-datadog.gemspec
119
119
  - lib/itamae/plugin/recipe/datadog.rb
120
120
  - lib/itamae/plugin/recipe/datadog/install.rb
121
+ - lib/itamae/plugin/recipe/datadog/install_datadog_agent_integration.rb
121
122
  - lib/itamae/plugin/recipe/datadog/version.rb
122
123
  homepage: https://github.com/itamae-plugins/itamae-plugin-recipe-datadog
123
124
  licenses: