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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# File 'manifests/component/frontdoor.pp', line 4
class complyadm::component::frontdoor (
Complyadm::Config::Comply_frontdoor $config
) {
include complyadm::log_rotation
$container = $config['container']
$conf_file = '/etc/puppetlabs/comply/frontdoor_proxy_nginx.conf'
file { $conf_file:
ensure => 'file',
content => epp('complyadm/frontdoor/nginx_conf.epp', { runtime => $container['runtime'] }),
owner => 'root',
group => 'root',
seltype => 'container_file_t',
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']],
}
$cert_chain = '/etc/puppetlabs/comply/comply_certs/cert_chain.pem'
file { $cert_chain:
ensure => 'file',
content => $config['cert_chain'],
owner => 'root',
group => 'root',
seltype => 'container_file_t',
notify => Complyadm::Runtime::Run[$container['name']],
}
$private_key = '/etc/puppetlabs/comply/comply_certs/private_key.pem'
file { $private_key:
ensure => 'file',
content => $config['private_key'],
owner => 'root',
group => 'root',
seltype => 'container_file_t',
notify => Complyadm::Runtime::Run[$container['name']],
}
$crl = '/etc/puppetlabs/comply/comply_certs/crl.pem'
file { $crl:
ensure => 'file',
content => $config['crl'],
owner => 'root',
group => 'root',
seltype => 'container_file_t',
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'],
extra_parameters => $container['extra_parameters'],
ports => $container['ports'],
pull_on_start => false,
volumes => [
"${conf_file}:/opt/bitnami/nginx/conf/nginx.conf",
'/etc/puppetlabs/comply/comply_certs:/certs',
'/etc/puppetlabs/comply/nginx_healthcheck.sh:/health/nginx_healthcheck.sh',
],
after => $container['after'],
}
}
|