Puppet Function: wmflib::class::hosts

Defined in:
modules/wmflib/functions/class/hosts.pp
Function type:
Puppet Language

Summary

function to return a list of hosts running a specific class This function relies on data being present in puppetdb. This means that new nodes will be returned after their first successful puppet run using the specified class. It also means that nodes will be removed from the results once they have been purged from puppetdb. This currently happens when a server has failed to run puppet for 14 days

Overview

wmflib::class::hosts(Wmflib::Resource::Type $class, Variant[Wmflib::Sites, Array[Wmflib::Sites]] $location = [])Array[Stdlib::Host]

Parameters:

  • class (Wmflib::Resource::Type)

    the class to search for

  • optional

    list of sites if present filter to output based on the sites passed

  • location (Variant[Wmflib::Sites, Array[Wmflib::Sites]]) (defaults to: [])

Returns:

  • (Array[Stdlib::Host])


8
9
10
11
12
13
14
# File 'modules/wmflib/functions/class/hosts.pp', line 8

function wmflib::class::hosts (
    Wmflib::Resource::Type                       $class,
    Variant[Wmflib::Sites, Array[Wmflib::Sites]] $location = [],
) >> Array[Stdlib::Host] {

    wmflib::resource::hosts('class', $location, wmflib::resource::capitalize($class))
}