blob: 4ff69df081677863ae06be97714f8ba1ec745560 [file] [log] [blame]
# Class: datadog_agent::ubuntu
#
# This class contains the DataDog agent installation mechanism for Ubuntu
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
class datadog_agent::ubuntu(
$apt_key = 'C7A7DA52'
) {
exec { "datadog_key":
command => "/usr/bin/apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $apt_key",
unless => "/usr/bin/apt-key list | grep $apt_key | grep expires",
notify => Exec['datadog_apt-get_update'],
}
file { "/etc/apt/sources.list.d/datadog.list":
source => "puppet:///modules/datadog_agent/datadog.list",
owner => 'root',
group => 'root',
notify => Exec['datadog_apt-get_update'],
}
exec { 'datadog_apt-get_update':
command => '/usr/bin/apt-get update',
refreshonly => true,
}
package { "datadog-agent-base":
ensure => absent,
before => Package['datadog-agent'],
}
package { "datadog-agent":
ensure => latest,
require => [ File["/etc/apt/sources.list.d/datadog.list"], Exec['datadog_apt-get_update'] ],
}
service { "datadog-agent":
ensure => $::datadog_agent::service_ensure,
enable => $::datadog_agent::service_enable,
hasstatus => false,
pattern => 'dd-agent',
require => Package["datadog-agent"],
}
}