Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit d4d58fe

Browse files
author
Jarret Lavallee
committed
Simplify puppetdb v2 logic
Prior to this commit, the puppetdb v2 logic was more complex than needed. This update changes to anything over 5.5.19 to use v2, which should fix the issues with some newer versions using v1 metrics.
1 parent a1c4e12 commit d4d58fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

functions/localhost_or_hosts_with_pe_profile.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function puppet_metrics_dashboard::localhost_or_hosts_with_pe_profile(
1818
# PE 2018.1.13 - PE 2019.0.0
1919
# PE 2019.5 - PE 2019.8.4
2020
$hosts = puppetdb_query('inventory[certname]{
21-
facts.puppet_metrics_dashboard.versions.puppetdb > "6.15.0" or
21+
facts.puppet_metrics_dashboard.versions.puppetdb >= "6.15.0" or
2222
facts.puppet_metrics_dashboard.versions.puppetdb < "5.2.13"
2323
}').map |$nodes| { $nodes['certname'] }
2424
} else {

functions/puppetdb_v2_metrics.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# @summary function used to determine if the metrics v2 endpoint in PuppetDB can be used
22

33
function puppet_metrics_dashboard::puppetdb_v2_metrics() >> Boolean {
4-
if ((versioncmp($facts['puppetversion'], '6.14.0') >= 0) or ((versioncmp($facts['puppetversion'], '5.5.19') >= 0) and (versioncmp($facts['puppetversion'], '6.0.0') < 1))) {
4+
if versioncmp($facts['puppetversion'], '5.5.19') >= 0 {
55
true
66
} else {
77
false

0 commit comments

Comments
 (0)