Puppet Class: classroom_legacy::master

Defined in:
manifests/master.pp

Overview

Set up the master with user accounts, environments, etc

Parameters:

  • jvm_tuning_profile (Any) (defaults to: $classroom_legacy::params::jvm_tuning_profile)


2
3
4
5
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'manifests/master.pp', line 2

class classroom_legacy::master (
  $jvm_tuning_profile = $classroom_legacy::params::jvm_tuning_profile,
) {
  assert_private('This class should not be called directly')

  # Workaround for pip
  file {'/usr/bin/pip-python':
    ensure => link,
    target => '/usr/bin/pip',
  }

  # Install the Gitea hosted git repository service
  include classroom_legacy::master::gitea

  # Add the installer files for student agents
  # These files are cached by the build, so this will work offline
  include pe_repo::platform::el_6_i386
  include pe_repo::platform::windows_x86_64

  # Anything that needs to be top scope
  file { "${classroom_legacy::codedir}/environments/production/manifests/classroom.pp":
    ensure => file,
    owner  => 'pe-puppet',
    group  => 'pe-puppet',
    mode   => '0644',
    source => 'puppet:///modules/classroom_legacy/classroom.pp',
  }

  # if configured to do so, configure repos & environments on the master. This
  # overrides the resource in the puppet_enterprise module and allows us to have
  # different users updating their own repositories.
  if $classroom_legacy::manage_repos {
    $environmentspath = "${classroom_legacy::codedir}/environments"

    # 2015.2.x manages the environmentpath but doesn't allow users to write
    if versioncmp($::pe_server_version,'2015.3.0') < 0 {
      File <| title == $environmentspath |> {
        mode => '1777',
      }
    }
    # 2015.3.x doesn't manage the environmentpath
    else {
      file { $environmentspath:
        ensure => directory,
        mode   => '1777',
      }
    }

    include classroom_legacy::master::repositories
  }

  # Ensure that time is set appropriately
  include classroom_legacy::master::time

  # Configure Hiera and install a Hiera data file to control PE configuration
  class { 'classroom_legacy::master::tuning':
    jvm_tuning_profile => $jvm_tuning_profile,
  }

  # make sure we have a deployment user
  include classroom_legacy::master::deployer

  # Setup Windows Powershell Scripts
  include classroom_legacy::master::windows

  # Now create all of the users who've checked in
  Classroom_legacy::User <<||>>
  # But prevent students from overwriting the login ssh key
  user { 'training':
    ensure => present,
  }

  # Add files required for labs (mostly for offline mode)
  include classroom_legacy::master::lab_files

  # Configure performance logging
  include classroom_legacy::master::perf_logging

}