Puppet Function: influxdb::hosts_with_pe_profile

Defined in:
functions/hosts_with_pe_profile.pp
Function type:
Puppet Language

Overview

influxdb::hosts_with_pe_profile(String $profile)Array

Parameters:

  • profile (String)

Returns:

  • (Array)


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'functions/hosts_with_pe_profile.pp', line 12

function influxdb::hosts_with_pe_profile(
  String $profile,
) >> Array {
  if $settings::storeconfigs {
  $hosts = puppetdb_query("resources[certname] {
      type = 'Class' and
      title = 'Puppet_enterprise::Profile::${profile}' and
      nodes { deactivated is null and expired is null }
    }").map |$nodes| { $nodes['certname'] }
  } else {
    $hosts = []
  }
  if empty($hosts) {
    [$trusted['certname']]
  } else {
    sort($hosts)
  }
}