Puppet Function: profile::mariadb::section_params::is_read_only

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

Overview

profile::mariadb::section_params::is_read_only(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
# File 'modules/profile/functions/mariadb/section_params/is_read_only.pp', line 1

function profile::mariadb::section_params::is_read_only(
    Profile::Mariadb::Valid_section $section,
    Profile::Mariadb::Role $role,
) >> Boolean {
    if profile::mariadb::section_params::writeable_dc($section) == 'none' {
        true
    } else {
        $writeable_dc = profile::mariadb::section_params::is_writeable_dc($section)
        $role ? {
            'standalone' => $writeable_dc,
            'slave' => true,
            'master' => !$writeable_dc,
            default => fail("Unsupported mysql_role: ${role}"),
        }
    }
}