Puppet Class: archlinux_workstation::docker
- Defined in:
- manifests/docker.pp
Overview
Install and run Docker; add
$archlinux_workstation::username
to the docker
group. This class wraps an instance of the garethr/docker module.
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 |
# File 'manifests/docker.pp', line 10
class archlinux_workstation::docker(
Enum['stopped', 'running'] $service_state = 'running',
) {
if ! defined(Class['archlinux_workstation']) {
fail('You must include the base archlinux_workstation class before using any subclasses')
}
include archlinux_workstation
if ! defined(File['/etc/conf.d']) {
file {'/etc/conf.d':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
before => Class['docker'],
}
}
class {'docker':
service_state => $service_state,
}
# add the user defined in init.pp to docker group with plusignment
User<| title == $archlinux_workstation::username |> {
groups +> ['docker'],
require +> [ Class['docker'] ],
}
}
|