Puppet Class: classroom_legacy::master::codemanager

Inherits:
classroom_legacy::params
Defined in:
manifests/master/codemanager.pp

Overview

Configuration for PE code manager to avoid chicken -> egg -> chicken

Parameters:

  • control_repo (Any)


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
# File 'manifests/master/codemanager.pp', line 2

class classroom_legacy::master::codemanager (
  $control_repo,
) inherits classroom_legacy::params {
  assert_private('This class should not be called directly')

  $control_owner = $classroom_legacy::params::control_owner
  $gitserver     = $classroom_legacy::params::gitserver

  pe_hocon_setting { 'enable code manager':
    ensure  => present,
    path    => '/etc/puppetlabs/enterprise/conf.d/common.conf',
    setting => '"puppet_enterprise::profile::master::code_manager_auto_configure"',
    value   => true,
  }

  pe_hocon_setting { 'production control repo':
    ensure  => present,
    path    => '/etc/puppetlabs/enterprise/conf.d/common.conf',
    setting => '"puppet_enterprise::master::code_manager::sources".main',
    value   => { 'remote' => "${gitserver}/${control_owner}/${control_repo}" },
  }


  # duplicated in a hiera datasource. because reasons.
  $hieradata = "${classroom_legacy::params::confdir}/hieradata"
  # we will likely never go back to the per-user fork model, but we should keep
  # this until we rip it out across the board.
  $replace   = $classroom_legacy::params::repo_model ? {
    'single'  => true,
    'peruser' => false, # the puppetfactory hook must be able to update this list!
  }
  file { "${hieradata}/sources.yaml":
    ensure  => file,
    content => epp('classroom_legacy/hiera/data/sources.yaml.epp', {
                                      'gitserver'     => $gitserver,
                                      'control_owner' => $control_owner,
                                      'control_repo'  => $control_repo }),
  }
}