Puppet Class: profile::analytics::refinery

Defined in:
modules/profile/manifests/analytics/refinery.pp

Overview

Class profile::analytics::refinery

Includes configuration and resources needed for deploying and using the analytics/refinery repository.

Parameters:

  • deploy_hadoop_config (Any) (defaults to: hiera('profile::analytics::refinery::deploy_hadoop_config', true))


6
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'modules/profile/manifests/analytics/refinery.pp', line 6

class profile::analytics::refinery (
    $deploy_hadoop_config = hiera('profile::analytics::refinery::deploy_hadoop_config', true)
) {
    if $deploy_hadoop_config {
        # Make this class depend on hadoop::common configs.  Refinery
        # is intended to work with Hadoop, and many of the
        # role classes here use the hdfs user, which is created
        # by the CDH packages.
        require ::profile::hadoop::common

        require ::profile::analytics::cluster::packages::hadoop
    }

    require ::profile::analytics::refinery::repository

    # Needed to make the analytics-mysql tool work
    package { 'python3-dnspython':
        ensure => installed,
    }

    # Wrapper script to ease the use of the analytics-mysql
    # tool (shipped with Refinery)
    file { '/usr/local/bin/analytics-mysql':
        source => 'puppet:///modules/profile/analytics/refinery/analytics-mysql',
        mode   => '0555'
    }

    # Required by a lot of profiles dependent on this one
    # to find the correct path for scripts etc..
    $path = $::profile::analytics::refinery::repository::path

    # Create directory in /etc for general purpose refinery config.
    $config_dir = '/etc/refinery'
    file { $config_dir:
        ensure => 'directory'
    }

    # Create directory in /var/log for general purpose Refinery job logging.
    $log_dir = '/var/log/refinery'
    $log_dir_group = $::realm ? {
        'production' => 'analytics',
        'labs'       => "project-${::labsproject}",
    }

    if $deploy_hadoop_config {
        file { $log_dir:
            ensure => 'directory',
            owner  => 'hdfs',
            group  => $log_dir_group,
            # setgid bit here to make refinery log files writeable
            # by users in the $log_dir_group group.
            mode   => '2775',
        }

        logrotate::conf { 'refinery':
            source  => 'puppet:///modules/profile/analytics/refinery-logrotate.conf',
            require => File[$log_dir],
        }
    }
}