Puppet Class: docker

Defined in:
manifests/init.pp

Overview

Parameters:

  • ensure (Variant[Boolean,String]) (defaults to: present)
  • install_class (String) (defaults to: '::docker::install::tp')
  • username (String[1]) (defaults to: 'example42')
  • options (Hash) (defaults to: { })
  • settings (Hash) (defaults to: { })
  • profiles (Array) (defaults to: [])
  • auto_restart (Boolean) (defaults to: true)
  • auto_conf (Boolean) (defaults to: false)
  • run (Variant[Undef,Hash]) (defaults to: undef)
  • build (Variant[Undef,Hash]) (defaults to: undef)
  • test (Variant[Undef,Hash]) (defaults to: undef)
  • push (Variant[Undef,Hash]) (defaults to: undef)
  • data_module (String[1]) (defaults to: 'docker')
  • tinydata_module (String[1]) (defaults to: 'tinydata')


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
# File 'manifests/init.pp', line 3

class docker (

  Variant[Boolean,String] $ensure           = present,

  String                  $install_class    = '::docker::install::tp',
 
  String[1]               $username         = 'example42',

  Hash                    $options          = { },
  Hash                    $settings         = { },

  Array                   $profiles         = [],

  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         = 'docker',
  String[1]               $tinydata_module     = 'tinydata',

  ) {


  $tp_settings = tp_lookup('docker','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 "::docker::profile::${kl}"
    }
  }

  if $run {
    create_resources('docker::run', $run )
  }
  if $build {
    create_resources('docker::tp_build', $build )
  }
  if $test {
    create_resources('docker::test', $test )
  }
  if $push {
    create_resources('docker::push', $push )
  }
}