Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterize chef-handler-datadog Gem version #60

Merged
merged 1 commit into from
Aug 20, 2013
Merged
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
7 changes: 5 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# The host of the Datadog intake server to send agent data to
default['datadog']['url'] = "https://app.datadoghq.com"

# Add tags as override attributes in your role
# Add tags as override attributes in your role
default['datadog']['tags'] = ""

# Repository configuration
Expand All @@ -41,7 +41,10 @@
# Agent Version
default['datadog']['agent_version'] = nil

# Boolean to enable debug_mode, which outputs massive amounts of log messages
# Chef handler version
default['datadog']['chef_handler_version'] = nil

# Boolean to enable debug_mode, which outputs massive amounts of log messages
# to the /tmp/ directory.
default['datadog']['debug'] = false

Expand Down
6 changes: 5 additions & 1 deletion recipes/dd-handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@
# TODO: Remove once 0.10.8 is fully end-of-life
r = gem_package "chef-handler-datadog" do
action :nothing
version node["datadog"]["chef_handler_version"]
end
r.run_action(:install)
Gem.clear_paths
else
# The chef_gem provider was introduced in Chef 0.10.10
chef_gem "chef-handler-datadog"
chef_gem "chef-handler-datadog" do
action :install
version node["datadog"]["chef_handler_version"]
end
end
require 'chef/handler/datadog'

Expand Down