Puppet Function: profile::mariadb::section_params::is_repl_client

Defined in:
modules/profile/functions/mariadb/section_params/is_repl_client.pp
Function type:
Puppet Language

Overview

profile::mariadb::section_params::is_repl_client(Profile::Mariadb::Valid_section $section, Profile::Mariadb::Role $role)Boolean

Parameters:

  • section (Profile::Mariadb::Valid_section)
  • role (Profile::Mariadb::Role)

Returns:

  • (Boolean)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'modules/profile/functions/mariadb/section_params/is_repl_client.pp', line 1

function profile::mariadb::section_params::is_repl_client(
    Profile::Mariadb::Valid_section $section,
    Profile::Mariadb::Role $role,
) >> Boolean {
    case $role {
        'standalone': {
            false
        }
        'slave': {
            true
        }
        'master': {
            $repl_type = profile::mariadb::section_params::replication_type($section)
            $repl_type ? {
                'none' => false,
                'bidir' => true,
                'unidir' => !profile::mariadb::section_params::is_writeable_dc($section),
                default => fail("Unsupported inter-dc replication type: ${repl_type}"),
            }
        }
        default: {
            fail("Unsupported mysql_role: ${role}")
        }
    }
}