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
62
63
64
65
66
67
68
|
# File 'manifests/docker.pp', line 2
class psick::docker (
Variant[Boolean,String] $ensure = present,
String $install_class = 'psick::docker::tp',
String[1] $username = 'example42',
Hash $options = { },
Hash $settings = { },
Array $profiles = [],
Array $allowed_users = [],
Boolean $auto_restart = true,
Boolean $auto_conf = false,
Variant[Undef,Hash] $run = undef,
Variant[Undef,Hash] $build = undef,
Variant[Undef,Hash] $test = undef,
Variant[Undef,Hash] $push = undef,
String[1] $data_module = 'tinydata',
) {
$tp_settings = tp_lookup('docker-engine','settings',$data_module,'merge')
$module_settings = $tp_settings + $settings
if $module_settings['service_name'] and $auto_restart {
$service_notify = "Service[${module_settings['service_name']}]"
} else {
$service_notify = undef
}
if $install_class != '' {
contain $install_class
}
if $profiles != [] {
$profiles.each |$kl| {
contain "::psick::docker::profile::${kl}"
}
}
if $run {
create_resources('psick::docker::run', $run )
}
if $build {
create_resources('psick::docker::tp_build', $build )
}
if $test {
create_resources('psick::docker::test', $test )
}
if $push {
create_resources('psick::docker::push', $push )
}
$allowed_users.each | $u | {
exec { "Add ${u} to docker":
unless => "grep docker /etc/group | grep ${u}",
require => Class[$install_class],
command => "usermod -a -G docker ${u}",
}
}
}
|