---
name: groundcrew

description: >
  The ground crew registers a Garden worker with the ATC on an interval,
  advertises supported resource types, and cleans up ephemeral containers on
  shutdown.

templates:
  drain.erb: bin/drain
  beacon_ctl.erb: bin/beacon_ctl

  static_known_hosts.erb: config/static_known_hosts
  private_key.erb: config/private_key
  worker.json.erb: config/worker.json

packages:
  - pid_utils
  - generated_tsa_host_key
  - generated_worker_key
  - resource_discovery
  - groundcrew

  # colocate base resources
  - archive_resource
  - bosh_deployment_resource
  - bosh_io_release_resource
  - bosh_io_stemcell_resource
  - cf_resource
  - docker_image_resource
  - git_resource
  - github_release_resource
  - hg_resource
  - pool_resource
  - s3_resource
  - semver_resource
  - time_resource
  - tracker_resource
  - vagrant_cloud_resource

consumes:
- name: tsa
  type: tsa
  optional: true
- name: garden
  type: garden
  optional: true
- name: baggageclaim
  type: baggageclaim
  optional: true

properties:
  tsa.host:
    description: |
      IP or DNS address of the TSA server to register with.

      If not specified, the `tsa` link is used.

  tsa.port:
    description: |
      Port of the TSA server to register with.

      Only used when `tsa.host` is also specified. Otherwise the port is
      autodiscovered via the `tsa` link.
    default: 2222

  tsa.host_public_key:
    description: >
      Host key to verify for the TSA server.

      If not specified, a deployment-scoped default is used.
    default: ""

  tsa.private_key:
    description: |
      Private key to use when authenticating with the TSA.

      If not specified, a deployment-scoped default is used.
    default: ""

  garden.address:
    description: |
      Garden server connection address to advertise directly to the TSA.

      If not specified, either the `garden` link is used, or
      the instance's address is advertised if the link is not
      found.

  garden.forward_address:
    description: |
      Garden server connection address to forward through SSH to the TSA.

      If not specified, the Garden server address is registered directly.

  baggageclaim.url:
    description: |
      Baggageclaim server URL to advertise directly to the
      TSA.

      If not specified, either the `baggageclaim` link is
      used.

  baggageclaim.forward_address:
    description: |
      Baggageclaim server connection address to forward through SSH to the TSA.

      If not specified, the Baggageclaim server address is registered directly.

  platform:
    description: |
      Platform to advertise for each worker.
    default: linux

  team:
    description: |
      Register the worker for a single team.

      If not specified, the worker will be shared across all teams.
    default: ""

  tags:
    description: |
      An array of tags to advertise for each worker.
    default: []

  http_proxy_url:
    description: |
      Proxy to use for outgoing http requests from containers.

  https_proxy_url:
    description: |
      Proxy to use for outgoing https requests from containers.

  no_proxy:
    description: |
      A list domains and IPs with optional port for which the proxy should be bypassed, e.g. [localhost, 127.0.0.1, example.com, domain.com:8080]
    default: []

  additional_resource_types:
    description: |
      Additional resource types supported by the workers in `[{type: string, image: string}]` format.
    default: []

  drain_timeout:
    description: |
      Maximum wait time in Go duration format (1m = 1 minute) for worker drain
      to be finished. Only applies when worker is getting shutdown.

      If not specified, it will be indefinite.

  yeller.api_key:
    description: |
      API key to output errors from Concourse to Yeller.
    default: ""

  yeller.environment_name:
    description: |
      Environment name you wish to group errors under in yeller.
    default: ""
