Puppet Class: complyadm::component::graphql

Defined in:
manifests/component/graphql.pp

Summary

installs and configures the main backend component

Overview

Parameters:

  • config (Complyadm::Config::Comply_graphql)

    subset of Complyadm::Config specific to graphql



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
# File 'manifests/component/graphql.pp', line 4

class complyadm::component::graphql (
  Complyadm::Config::Comply_graphql $config,
) {
  $container = $config['container']

  $graphql_env = '/etc/puppetlabs/comply/graphql.env'
  file { $graphql_env:
    ensure    => file,
    owner     => 'root',
    group     => 'root',
    seltype   => 'container_file_t',
    show_diff => false,
    content   => epp('complyadm/comply_env.epp', { env_vars => $container['env_vars'] }),
    notify    => Complyadm::Runtime::Run[$container['name']],
  }

  $healthcheck_file = "/etc/puppetlabs/comply/${container['name']}-healthcheck.sh"
  file { $healthcheck_file:
    ensure    => file,
    owner     => 'root',
    group     => 'root',
    mode      => '+x',
    seltype   => 'container_file_t',
    show_diff => false,
    content   => epp('complyadm/runtime/service-watchdog.epp', { healthcheck => "${container['runtime']} exec ${container['name']} ${container['healthcheck']}" }),
    notify    => Complyadm::Runtime::Run[$container['name']],
  }

  complyadm::runtime::run { $container['name']:
    runtime                  => $container['runtime'],
    install_runtime          => $container['install_runtime'],
    image                    => $container['image'],
    net                      => $container['net'],
    ports                    => $container['ports'],
    extra_parameters         => $container['extra_parameters'],
    after_create             => $healthcheck_file,
    extra_systemd_parameters => $container['extra_systemd_parameters'],
    pull_on_start            => false,
    env_file                 => [$graphql_env],
    require                  => File[$graphql_env],
    after                    => $container['after'],
  }
}