Skip to content

Commit d4e49f8

Browse files
committed
[apt] address beta repo management
1 parent 0bae27d commit d4e49f8

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

lib/facter/beta_repo.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
File.exist? '/etc/apt/sources.list.d/datadog-beta.list'
44
end
55
end
6+
7+
Facter.add('apt_agent6_repo') do
8+
setcode do
9+
File.exist? '/etc/apt/sources.list.d/datadog6.list'
10+
end
11+
end

manifests/ubuntu/agent5.pp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# hit this code path. We can't use 'Package' because we later have
4040
# to ensure dastadog-agent is present.
4141

42-
if $facts['apt_agent6_beta_repo'] and $agent_version == 'latest' {
42+
if ($facts['apt_agent6_beta_repo'] or $facts['apt_agent6_beta_repo']) and $agent_version == 'latest' {
4343
exec { 'datadog_apt-get_remove_agent6':
4444
command => '/usr/bin/apt-get remove -y -q datadog-agent',
4545
}
@@ -53,6 +53,11 @@
5353
}
5454

5555
if $facts['apt_agent6_beta_repo'] {
56+
apt::source { 'datadog-beta':
57+
ensure => absent,
58+
}
59+
}
60+
if $facts['apt_agent6_repo'] {
5661
apt::source { 'datadog6':
5762
ensure => absent,
5863
}

0 commit comments

Comments
 (0)