Puppet Function: ganeti::known_hosts

Defined in:
modules/ganeti/functions/known_hosts.pp
Function type:
Puppet Language

Overview

ganeti::known_hosts(Stdlib::Host $ganeti_cluster)String[1]

SPDX-License-Identifier: Apache-2.0

Queries for the SSH public host keys of all the members of a given ganeti cluster

Parameters:

  • ganeti_cluster (Stdlib::Host)

Returns:



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'modules/ganeti/functions/known_hosts.pp', line 5

function ganeti::known_hosts (
    Stdlib::Host $ganeti_cluster,

) >> String[1] {
    $pql = @("PQL")
        inventory[certname, facts.ssh.rsa.key] {
            facts.ganeti_cluster = "${ganeti_cluster}"
        }
        | PQL
    wmflib::puppetdb_query($pql).reduce('') |$memo, $host| {
        "${memo}${host['certname']} ssh-rsa ${host['facts.ssh.rsa.key']}\n"
    }
}