forked from DataDog/puppet-datadog-agent
/
ubuntu.pp
44 lines (38 loc) · 1.04 KB
/
ubuntu.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Class: datadog::ubuntu
#
# This class contains the DataDog agent installation mechanism for Ubuntu
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
class datadog::ubuntu {
exec { "datadog_key":
command => "/usr/bin/apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C7A7DA52",
unless => "/usr/bin/apt-key list | grep C7A7DA52",
notify => Exec['datadog_apt-get_update'],
}
file { "/etc/apt/sources.list.d/datadog.list":
source => "puppet:///modules/datadog/datadog.list",
notify => Exec['datadog_apt-get_update'],
}
exec { 'datadog_apt-get_update':
command => '/usr/bin/apt-get update',
refreshonly => true,
}
package { "datadog-agent":
ensure => latest,
require => [ File["/etc/apt/sources.list.d/datadog.list"], Exec['datadog_apt-get_update'] ],
}
service { "datadog-agent":
ensure => running,
enable => true,
hasstatus => false,
pattern => 'dd-agent',
require => Package["datadog-agent"],
}
}