Defined Type: bigtop::mysql_jdbc

Defined in:
modules/bigtop/manifests/mysql_jdbc.pp

Overview

SPDX-License-Identifier: Apache-2.0

define bigtop::mysql_jdbc

Helper to deploy Mysql/Mariadb jars and custom symlinks where needed.

Parameters:

  • link_path (String)
  • use_mysql_jar (Optional[Boolean]) (defaults to: false)


7
8
9
10
11
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
# File 'modules/bigtop/manifests/mysql_jdbc.pp', line 7

define bigtop::mysql_jdbc (
    String $link_path,
    Optional[Boolean] $use_mysql_jar = false,
) {
    $jar_path = $use_mysql_jar ? {
        true    => '/usr/share/java/mysql.jar',
        default => '/usr/share/java/mysql-connector-java.jar',
    }

    $package_name = 'libmysql-java'
    if debian::codename::eq('buster') {
        if !defined(Apt::Package_from_component['libmysql-java-component']) {
            apt::package_from_component { 'libmysql-java-component':
                component => 'component/libmysql-java',
                packages  => [$package_name]
            }
        }
    } else {
        # $package_name = 'libmariadb-java'
        # $jar_path = '/usr/share/java/mariadb-java-client-2.3.0.jar'
        # See https://phabricator.wikimedia.org/T278424
        fail('OS not supported, please follow up with the Analytics team. Context: T278424')
    }

    ensure_packages($package_name)
    file { $link_path:
        ensure  => 'link',
        target  => $jar_path,
        require => Package[$package_name],
    }
}