Defined Type: profile::mariadb::ferm

Defined in:
modules/profile/manifests/mariadb/ferm.pp

Overview

Parameters:

  • port (Any) (defaults to: '3306')


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'modules/profile/manifests/mariadb/ferm.pp', line 12

define profile::mariadb::ferm (
    $port = '3306',
) {
    if $port == '3306' {
        $rule_name = 'mariadb_internal'
    } else {
        $rule_name = "${title}_mariadb_internal"
    }
    ferm::service{ $rule_name:
        proto   => 'tcp',
        port    => $port,
        notrack => true,
        srange  => '$INTERNAL',
    }

    # auxiliary port
    if $port == '3306' {
        $extra_port = 3307
    } else {
        $extra_port = 20 + $port
    }
    ferm::service { "${title}_mariadb_dba":
        proto  => 'tcp',
        port   => $extra_port,
        srange => '$MYSQL_ROOT_CLIENTS',
    }
}