Puppet Class: cdh::hadoop::users

Defined in:
modules/cdh/manifests/hadoop/users.pp

Overview

Class cdh::hadoop::users

Ensures that all users in the posix group $group have HDFS user directories at /user/<username>

Parameters

$groups - Space separated group names in which all users should have

access to Hadoop.  Default: hadoop

Usage

The following will ensure that all users in the posix groups 'my-analytics-group' and 'my-analytics-admin-group' have HDFS user directories.

class { 'cdh::hadoop::users':
    groups => 'my-analytics-group my-analytics-admin-group',
}

Parameters:

  • groups (Any) (defaults to: ['hadoop'])
  • use_kerberos (Any) (defaults to: false)


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'modules/cdh/manifests/hadoop/users.pp', line 18

class cdh::hadoop::users(
    $groups = ['hadoop'],
    $use_kerberos = false,
) {
    Class['cdh::hadoop'] -> Class['cdh::hadoop::users']

    file { '/usr/local/bin/create_hdfs_user_directories.sh':
        source => 'puppet:///modules/cdh/hadoop/create_hdfs_user_directories.sh',
        owner  => 'root',
        group  => 'hdfs',
        mode   => '0554',
    }

    cdh::exec { 'create_hdfs_user_directories':
        command      => "/usr/local/bin/create_hdfs_user_directories.sh --verbose ${groups}",
        unless       => "/usr/local/bin/create_hdfs_user_directories.sh --check-for-changes ${groups}",
        user         => 'hdfs',
        logoutput    => true,
        timeout      => 120,
        use_kerberos => $use_kerberos,
    }
}