Skip to content

Commit dee3469

Browse files
committed
[integrations] remove legacy config locations on Agent6
1 parent 9897f7e commit dee3469

47 files changed

Lines changed: 236 additions & 47 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

manifests/integrations/apache.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@
3939
validate_legacy('Array', 'validate_array', $tags)
4040
validate_legacy('Boolean', 'validate_bool', $disable_ssl_validation)
4141

42+
$legacy_dst = "${datadog_agent::conf_dir}/apache.yaml"
4243
if !$::datadog_agent::agent5_enable {
4344
$dst = "${datadog_agent::conf6_dir}/apache.d/conf.yaml"
45+
file { $legacy_dst:
46+
ensure => 'absent'
47+
}
4448
} else {
45-
$dst = "${datadog_agent::conf_dir}/apache.yaml"
49+
$dst = $legacy_dst
4650
}
4751

4852
file { $dst:

manifests/integrations/cacti.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@
2020
) inherits datadog_agent::params {
2121
include datadog_agent
2222

23+
$legacy_dst = "${datadog_agent::conf_dir}/cacti.yaml"
2324
if !$::datadog_agent::agent5_enable {
2425
$dst = "${datadog_agent::conf6_dir}/cacti.d/conf.yaml"
26+
file { $legacy_dst:
27+
ensure => 'absent'
28+
}
2529
} else {
26-
$dst = "${datadog_agent::conf_dir}/cacti.yaml"
30+
$dst = $legacy_dst
2731
}
2832

2933
file { $dst:

manifests/integrations/cassandra.pp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,15 @@
3636

3737
validate_legacy(Optional[Hash], 'validate_hash', $tags)
3838

39+
$legacy_dst = "${datadog_agent::conf_dir}/cassandra.yaml"
3940
if !$::datadog_agent::agent5_enable {
4041
$dst = "${datadog_agent::conf6_dir}/cassandra.d/conf.yaml"
42+
43+
file { $legacy_dst:
44+
ensure => 'absent'
45+
}
4146
} else {
42-
$dst = "${datadog_agent::conf_dir}/cassandra.yaml"
47+
$dst = $legacy_dst
4348
}
4449

4550
file { $dst:

manifests/integrations/ceph.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@
2626
content => "# This file is required for dd ceph \ndd-agent ALL=(ALL) NOPASSWD:/usr/bin/ceph\n"
2727
}
2828

29+
$legacy_dst = "${datadog_agent::conf_dir}/ceph.yaml"
2930
if !$::datadog_agent::agent5_enable {
3031
$dst = "${datadog_agent::conf6_dir}/ceph.d/conf.yaml"
32+
file { $legacy_dst:
33+
ensure => 'absent'
34+
}
3135
} else {
32-
$dst = "${datadog_agent::conf_dir}/ceph.yaml"
36+
$dst = $legacy_dst
3337
}
3438

3539
file { $dst:

manifests/integrations/consul.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@
4040
validate_legacy('Boolean', 'validate_bool', $new_leader_checks)
4141
validate_legacy('Optional[Array]', 'validate_array', $service_whitelist)
4242

43+
$legacy_dst = "${datadog_agent::conf_dir}/consul.yaml"
4344
if !$::datadog_agent::agent5_enable {
4445
$dst = "${datadog_agent::conf6_dir}/consul.d/conf.yaml"
46+
file { $legacy_dst:
47+
ensure => 'absent'
48+
}
4549
} else {
46-
$dst = "${datadog_agent::conf_dir}/consul.yaml"
50+
$dst = $legacy_dst
4751
}
4852

4953
file { $dst:

manifests/integrations/directory.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,14 @@
9393
$_instances = $instances
9494
}
9595

96+
$legacy_dst = "${datadog_agent::conf_dir}/directory.yaml"
9697
if !$::datadog_agent::agent5_enable {
9798
$dst = "${datadog_agent::conf6_dir}/directory.d/conf.yaml"
99+
file { $legacy_dst:
100+
ensure => 'absent'
101+
}
98102
} else {
99-
$dst = "${datadog_agent::conf_dir}/directory.yaml"
103+
$dst = $legacy_dst
100104
}
101105

102106
file { $dst:

manifests/integrations/disk.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@
4848
fail('error during compilation')
4949
}
5050

51+
$legacy_dst = "${datadog_agent::conf_dir}/disk.yaml"
5152
if !$::datadog_agent::agent5_enable {
5253
$dst = "${datadog_agent::conf6_dir}/disk.d/conf.yaml"
54+
file { $legacy_dst:
55+
ensure => 'absent'
56+
}
5357
} else {
54-
$dst = "${datadog_agent::conf_dir}/disk.yaml"
58+
$dst = $legacy_dst
5559
}
5660

5761
file { $dst:

manifests/integrations/dns_check.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@
3737

3838
validate_legacy('Array', 'validate_array', $checks)
3939

40+
$legacy_dst = "${datadog_agent::conf_dir}/dns_check.yaml"
4041
if !$::datadog_agent::agent5_enable {
4142
$dst = "${datadog_agent::conf6_dir}/dns_check.d/conf.yaml"
43+
file { $legacy_dst:
44+
ensure => 'absent'
45+
}
4246
} else {
43-
$dst = "${datadog_agent::conf_dir}/dns_check.yaml"
47+
$dst = $legacy_dst
4448
}
4549

4650
file { $dst:

manifests/integrations/elasticsearch.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,14 @@
7474
$_instances = $instances
7575
}
7676

77+
$legacy_dst = "${datadog_agent::conf_dir}/elastic.yaml"
7778
if !$::datadog_agent::agent5_enable {
7879
$dst = "${datadog_agent::conf6_dir}/elastic.d/conf.yaml"
80+
file { $legacy_dst:
81+
ensure => 'absent'
82+
}
7983
} else {
80-
$dst = "${datadog_agent::conf_dir}/elastic.yaml"
84+
$dst = $legacy_dst
8185
}
8286

8387
file { $dst:

manifests/integrations/fluentd.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@
2525

2626
validate_legacy('Optional[Array]', 'validate_array', $plugin_ids)
2727

28+
$legacy_dst = "${datadog_agent::conf_dir}/fluentd.yaml"
2829
if !$::datadog_agent::agent5_enable {
2930
$dst = "${datadog_agent::conf6_dir}/fluentd.d/conf.yaml"
31+
file { $legacy_dst:
32+
ensure => 'absent'
33+
}
3034
} else {
31-
$dst = "${datadog_agent::conf_dir}/fluentd.yaml"
35+
$dst = $legacy_dst
3236
}
3337

3438
file { $dst:

0 commit comments

Comments
 (0)