Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ By default, the current major version of this cookbook installs Agent v7. The fo
| `agent_major_version` | Pin the major version of the Agent to 5, 6, or 7 (default). |
| `agent_version` | Pin a specific Agent version (recommended). |
| `agent_package_action` | (Linux only) Defaults to `'install'` (recommended), `'upgrade'` to get automatic Agent updates (not recommended, use the default and change the pinned `agent_version` to upgrade). |
| `agent_flavor` | (Linux only) Defaults to `'datadog-agent'` to install the datadog-agent, can be set to `'datadog-iot-agent'` to install the IOT agent. |
| `agent_flavor` | (Linux only) Defaults to `'datadog-agent'` to install the datadog-agent, can be set to `'datadog-iot-agent'` to install the IOT agent and `'datadog-fips-agent'` |

See the sample [attributes/default.rb][1] for your cookbook version for all available attributes.

Expand Down
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# Example:
# default['datadog']['agent_version'] = '7.16.0'
default['datadog']['agent_version'] = nil # nil to install latest
# Agent flavor to install, acceptable values are "datadog-agent", "datadog-iot-agent"
# Agent flavor to install, acceptable values are "datadog-agent", "datadog-iot-agent", "datadog-fips-agent"
default['datadog']['agent_flavor'] = 'datadog-agent' # "datadog-agent" to install the datadog-agent package
default['datadog']['fips_proxy_version'] = nil
# Datadog FIPS proxy package name:
Expand Down
11 changes: 11 additions & 0 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ suites:
api_key: somenonnullapikeythats32charlong
application_key: alsonotnil

- name: dd-fips-agent
run_list:
- recipe[datadog::dd-agent]
attributes:
datadog: &DATADOG
api_key: somenonnullapikeythats32charlong
application_key: alsonotnil
install_info_enabled: true
agent_flavor: datadog-fips-agent
agent_version: '7.20.0~rc.3'

- name: dd-agent-iot
run_list:
- recipe[datadog::dd-agent]
Expand Down
1 change: 1 addition & 0 deletions libraries/recipe_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Datadog
class << self
ACCEPTABLE_AGENT_FLAVORS = %w[
datadog-agent
datadog-fips-agent
datadog-iot-agent
].freeze

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright:: 2011-Present, Datadog
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'spec_helper'

@agent_package_name = 'datadog-fips-agent'

describe package(@agent_package_name) do
it { should be_installed }
end

describe service(@agent_service_name) do
it { should be_running }
end

describe command('/opt/datadog-agent/bin/agent/agent status | grep -v "Instance ID"'), :if => os[:family] != 'windows' do
its(:exit_status) { should eq 0 }
its(:stdout) { should contain '[OK]' }
its(:stdout) { should_not contain 'ERROR' }
end

# The new APT keys are imported
describe command('apt-key list'), :if => ['debian', 'ubuntu'].include?(os[:family]) do
its(:exit_status) { should eq 0 }
its(:stdout) { should contain '06462314' }
its(:stdout) { should contain 'C0962C7D' }
its(:stdout) { should contain 'F14F620E' }
its(:stdout) { should contain '382E94DE' }
end

# The new RPM keys are imported
describe command('rpm -q gpg-pubkey-4f09d16b'), :if => os[:family] == 'redhat' do
its(:exit_status) { should eq 0 }
its(:stdout) { should contain 'gpg-pubkey-4f09d16b' }
end

describe command('rpm -q gpg-pubkey-b01082d3'), :if => os[:family] == 'redhat' do
its(:exit_status) { should eq 0 }
its(:stdout) { should contain 'gpg-pubkey-b01082d3' }
end

describe command('rpm -q gpg-pubkey-fd4bf915'), :if => os[:family] == 'redhat' do
its(:exit_status) { should eq 0 }
its(:stdout) { should contain 'gpg-pubkey-fd4bf915' }
end

describe command('rpm -q gpg-pubkey-e09422b3'), :if => os[:family] == 'redhat' do
its(:exit_status) { should eq 1 }
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright:: 2011-Present, Datadog
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'spec_helper'

@agent_package_name = 'datadog-iot-agent'

describe 'Install infos' do
let(:install_info_path) do
if os == :windows
"#{ENV['ProgramData']}\\Datadog\\install_info"
else
'/etc/datadog-agent/install_info'
end
end

let(:install_info) do
YAML.load_file(install_info_path)
end

it 'adds an install_info' do
expect(install_info['install_method']).to match(
'tool_version' => /chef-\d+\.\d+\.\d+/,
'tool' => 'chef',
'installer_version' => /^datadog_cookbook-\d+\.\d+\.\d+$/
)
end
end