Skip to content

Commit ae80ff4

Browse files
authored
[apt] make repository configurable. (#340)
* [apt] make repository configurable. * [travis] bump ruby `2.1.0` to `2.1.1`
1 parent eb609bd commit ae80ff4

5 files changed

Lines changed: 12 additions & 4 deletions

File tree

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ source "https://rubygems.org"
33
group :test do
44
gem "syck"
55
gem "safe_yaml", "~> 1.0.4"
6+
gem "hiera-eyaml", "~> 2.1.0"
67
gem "listen", "~> 3.0.0"
78
gem "puppet", ENV['PUPPET_VERSION'] || '~> 4.2.0'
89
gem "puppet-lint"

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ end
1111

1212
PuppetLint.configuration.relative = true
1313
PuppetLint.configuration.send("disable_80chars")
14-
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
14+
PuppetLint.configuration.log_format = "%{path}:%{line}:%{check}:%{KIND}:%{message}"
1515
PuppetLint.configuration.fail_on_warnings = true
1616

1717
# Forsake support for Puppet 2.6.2 for the benefit of cleaner code.

files/datadog.list

Lines changed: 0 additions & 1 deletion
This file was deleted.

manifests/ubuntu.pp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
class datadog_agent::ubuntu(
1616
$apt_key = 'A2923DFF56EDA6E76E55E492D3A80E30382E94DE',
1717
$agent_version = 'latest',
18-
$other_keys = ['935F5A436A5A6E8788F0765B226AE980C7A7DA52']
18+
$other_keys = ['935F5A436A5A6E8788F0765B226AE980C7A7DA52'],
19+
$location = 'https://apt.datadoghq.com',
20+
$release = 'stable',
21+
$repos = 'main',
1922
) {
2023

2124
ensure_packages(['apt-transport-https'])
@@ -31,9 +34,9 @@
3134
}
3235

3336
file { '/etc/apt/sources.list.d/datadog.list':
34-
source => 'puppet:///modules/datadog_agent/datadog.list',
3537
owner => 'root',
3638
group => 'root',
39+
content => template('datadog_agent/datadog.list.erb'),
3740
notify => Exec['datadog_apt-get_update'],
3841
require => Package['apt-transport-https'],
3942
}

templates/datadog.list.erb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Datadog dd-agent repository: managed by puppet
3+
#
4+
5+
deb <%= @location %> <%= @release %> <%= @repos %>

0 commit comments

Comments
 (0)