Permalink
Browse files

use apt cookbook for repo

  • Loading branch information...
1 parent 7dfad15 commit c9ac45cfdf1a857042d464c4f5c2b5e87e33a268 @smith smith committed Oct 25, 2011
Showing with 8 additions and 24 deletions.
  1. +1 −1 dd-agent/metadata.rb
  2. +7 −22 dd-agent/recipes/default.rb
  3. +0 −1 dd-agent/templates/ubuntu/datadog.list.erb
View
@@ -4,4 +4,4 @@
description "Installs/Configures dd-agent"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "1.0.0"
-
+depends 'apt'
@@ -7,35 +7,20 @@
# All rights reserved - Do Not Redistribute
#
-
# Only support Debian & Ubuntu (RedHat et al. coming soon)
case node.platform
when "debian", "ubuntu"
- # Get the key
- execute "sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C7A7DA52" do
- not_if "apt-key list | grep C7A7DA52"
- end
-
- # Add the repo
- template "/etc/apt/sources.list.d/datadog.list" do
- owner "root"
- group "root"
- mode 0755
- variables(
- :repo => node.datadog.repo
- )
+ apt_repository 'datadog' do
+ keyserver 'keyserver.ubuntu.com'
+ key 'C7A7DA52'
+ uri 'http://apt.datadoghq.com'
end
- # Update the repo
- execute "apt-get update"
-
- package "datadog-agent" do
- action [ :install, :upgrade ]
- end
+ package 'datadog-agent'
service "datadog-agent" do
- action :nothing
- supports :restart => true
+ action :enable
+ supports :restart => true
end
directory "/etc/dd-agent" do
@@ -1 +0,0 @@
-deb <%= @repo %> unstable main

0 comments on commit c9ac45c

Please sign in to comment.