Puppet Function: profile::kubernetes::deployment_server::mariadb_master_ips

Defined in:
modules/profile/functions/kubernetes/deployment_server/mariadb_master_ips.pp
Function type:
Puppet Language

Overview

profile::kubernetes::deployment_server::mariadb_master_ips(String $profile, String $host_prefix)Array[Stdlib::IP::Address, 0, 2]

SPDX-License-Identifier: Apache-2.0

Parameters:

Returns:

  • (Array[Stdlib::IP::Address, 0, 2])


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'modules/profile/functions/kubernetes/deployment_server/mariadb_master_ips.pp', line 2

function profile::kubernetes::deployment_server::mariadb_master_ips(String $profile, String $host_prefix) >> Array[Stdlib::IP::Address, 0, 2] {
  $pql = @("PQL")
    resources[certname] {
      type = "Class" and
      title = "${profile}" and
      parameters.is_mariadb_replica = false
      and certname ~ "${host_prefix}"
    }
    | PQL
  $res = wmflib::puppetdb_query($pql)
  if ($res == undef) {
    []
  } else {
    $mariadb_master_certname = $res[0]['certname']
    [ipresolve($mariadb_master_certname, 4), ipresolve($mariadb_master_certname, 6)]
  }
}