aboutsummaryrefslogtreecommitdiff
path: root/manifests/worker_key.pp
blob: ffac96da5b001e93d812e593e348898bb73b1fc2 (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
# @summary A worker (public) key for a given cluster.
#
# This resource is supposed to be created and exported by the worker
# resource, and then collected by the web resource.
#
# It should however be fine to create manual instances of this resource.
#
# @param content
#   Complete content of the key, as it appears on disk.
#   Mutually exclusive with source.
# @param source
#   Place where the complete contents of the key can be found.
#   Mutually exclusive with content.
# @param cluster
#   Which cluster this key is part of.
# @api private
define concourse::worker_key (
  String $cluster,
  Optional[String] $content = undef,
  Optional[Stdlib::Absolutepath] $source = undef,
) {
  if $content and $source {
    fail('Content and source are mutually exclusive')
  }

  concat::fragment { $name:
    content => $content,
    source  => $source,
    target  => "authorized_worker_keys - ${cluster}",
  }
}