Puppet Class: profile::presto::client

Defined in:
modules/profile/manifests/presto/client.pp

Overview

SPDX-License-Identifier: Apache-2.0

Class profile::presto::client

Installs presto-cli and configures it to contact the Presto service at $discovery_uri

Parameters

discovery_uri

URI to Presto discovery server. This is likely the same as the coordinator port.

presto_clusters_secrets

Hash of available/configured Presto clusters and their secret properties, like passwords, etc.. The following values will be checked in the hash table only if TLS/Kerberos configs are enabled (see in the code for the exact values).

- 'ssl_keystore_password'

Default: {}

Parameters:

  • cluster_name (String) (defaults to: lookup('profile::presto::cluster_name'))
  • discovery_uri (String) (defaults to: lookup('profile::presto::discovery_uri'))
  • use_kerberos (Boolean) (defaults to: lookup('profile::presto::use_kerberos', { 'default_value' => true }))
  • krb5_credential_cache_path (String) (defaults to: lookup('profile::presto::client::krb5_credential_cache_path', { 'default_value' => '/tmp/krb5cc_$(id -u)' }))
  • presto_clusters_secrets (Optional[Hash[String, Hash[String, String]]]) (defaults to: lookup('presto_clusters_secrets', { 'default_value' => {} }))


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'modules/profile/manifests/presto/client.pp', line 18

class profile::presto::client(
    String $cluster_name = lookup('profile::presto::cluster_name'),
    String $discovery_uri = lookup('profile::presto::discovery_uri'),
    Boolean $use_kerberos = lookup('profile::presto::use_kerberos', { 'default_value' => true }),
    String $krb5_credential_cache_path = lookup('profile::presto::client::krb5_credential_cache_path', { 'default_value' => '/tmp/krb5cc_$(id -u)' }),
    Optional[Hash[String, Hash[String, String]]] $presto_clusters_secrets = lookup('presto_clusters_secrets', { 'default_value' => {} }),
) {

    if $presto_clusters_secrets[$cluster_name] {
        # Presto seems not picking up the JVM default truststore's cert
        $ssl_truststore_path = '/etc/ssl/certs/java/cacerts'
        $ssl_truststore_password = 'changeit'

        file { '/usr/local/bin/presto':
            owner   => 'root',
            group   => 'root',
            mode    => '0555',
            content => template('profile/presto/presto_client_ssl_kerberos.erb'),
            require => Package['presto-cli'],
        }
    }

    class { '::presto::client':
        discovery_uri => $discovery_uri,
    }
}