summaryrefslogtreecommitdiff
path: root/manifests/concourse_complete.pp
blob: 4059124adedb2b5288e7b5515a2c59c6b7d20103 (plain)
1
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
# @summary A complete concourse setup.
#
# Configures all components of a concourse setup.
#
# Session signing key is the one generated by
#     concourse generate-key -t rsa -f session_signing_key
#
# The tsa key pair is the two files generated by
#     concourse generate-key -t ssh -f worker_key
class profiles::concourse_complete (
  Sensitive[String] $session_signing_key,
  Sensitive[String] $tsa_private_key,
  String $tsa_public_key,
) {
  $cluster = 'default'
  class { '::concourse':
    default_cluster => $cluster,
    clusters        => {
      $cluster => {
        # Database settings
        'postgres_user'       => 'concourse',
        'postgres_password'   => Sensitive(extlib::cache_data(
          'profiles::concourse',
          'postgres_password',
          extlib::random_password(25)
        )),
        'db_name'             => "atc-${cluster}",
        # worker settings
        'external_domain'     => 'concourse.adrift.space',
        'tsa_public_key'      => $tsa_public_key,
        # Web settings
        'tsa_private_key'     => $tsa_private_key,
        'session_signing_key' => $session_signing_key,
      },
    },
  }
  include ::profiles::postgresql

  concourse::database { 'Concourse Database':
  }

  include ::concourse::worker
  include ::concourse::web

  # Settings are gotten through hiera instead, all namespaced directly with
  # `concourse::auth::ldap::`.
  include ::concourse::auth::ldap

  concourse::proxy::nginx { 'concourse.adrift.space':
  }

  include ::concourse::fly

  @@dns::record { 'CNAME concourse.adrift.space.':
    type  => 'CNAME',
    zone  => 'adrift.space.',
    key   => 'concourse',
    value => 'gandalf.adrift.space.',
  }

}