Puppet Class: profile::docker::storage::loopback

Defined in:
modules/profile/manifests/docker/storage/loopback.pp

Overview

Class profile::docker::storage::loopback

Sets up the storage for the devicemanager storage driver when a loopback device is used.

Do NOT use for serving production traffic.

Parameters

dm_source

Source device for the /var/lib/docker directory

Parameters:

  • dm_source (Any) (defaults to: hiera('profile::docker::storage::loopback::dm_source', undef))


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
# File 'modules/profile/manifests/docker/storage/loopback.pp', line 12

class profile::docker::storage::loopback(
    $dm_source=hiera('profile::docker::storage::loopback::dm_source', undef)
) {
    $dm_target = '/var/lib/docker'

    Class['profile::docker::storage::loopback'] -> Service['docker']

    # This will be used in profile::docker::engine
    $options = {'storage-driver' => 'devicemapper'}

    file { $dm_target:
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
    }


    unless empty($dm_source) {
        mount { $dm_target:
            ensure  => mounted,
            device  => $dm_source,
            fstype  => 'ext4',
            options => 'defaults',
        }
    }

}