Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
- Puppet >= 5.5.10 < 7.0.0
- , , , ,
Tasks:
- node_ls
- node_rm
- node_update
- service_scale
Start using this module
Add this module to your Puppetfile:
mod 'puppetlabs-docker', '3.8.0'
Learn more about managing modules with a PuppetfileDocumentation
Docker
Table of Contents
- Description
- Setup
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
The Puppet docker module installs, configures, and manages Docker from the Docker repository. It supports the latest Docker CE (Community Edition) for Linux based distributions and Docker EE(Enterprise Edition) for Windows and Linux as well as legacy releases.
Due to the new naming convention for Docker packages, this module prefaces any params that refer to the release with _ce
or _engine
. Examples of these are documented in this README.
Setup
To create the Docker hosted repository and install the Docker package, add a single class to the manifest file:
include 'docker'
To configure package sources independently and disable automatically including sources, add the following code to the manifest file:
class { 'docker':
use_upstream_package_source => false,
}
The latest Docker repositories are now the default repositories for version 17.06 and above. If you are using an older version, the repositories are still configured based on the version number passed into the module.
To ensure the module configures the latest repositories, add the following code to the manifest file:
class { 'docker':
version => '17.09.0~ce-0~debian',
}
Using a version prior to 17.06, configures and installs from the old repositories:
class { 'docker':
version => '1.12.0-0~wheezy',
}
Docker provides a enterprise addition of the Docker Engine, called Docker EE. To install Docker EE on Debian systems, add the following code to the manifest file:
class { 'docker':
docker_ee => true,
docker_ee_source_location => 'https://<docker_ee_repo_url>',
docker_ee_key_source => 'https://<docker_ee_key_source_url>',
docker_ee_key_id => '<key id>',
}
To install Docker EE on RHEL/CentOS:
class { 'docker':
docker_ee => true,
docker_ee_source_location => 'https://<docker_ee_repo_url>',
docker_ee_key_source => 'https://<docker_ee_key_source_url>',
}
For CentOS distributions, the docker module requires packages from the extras repository which is enabled by default on CentOS. For more information, see the official CentOS documentation and the official Docker documentation.
For Red Hat Enterprise Linux (RHEL) based distributions, the docker module uses the upstream repositories. To continue using the legacy distribution packages in the CentOS extras repository, add the following code to the manifest file:
class { 'docker':
use_upstream_package_source => false,
service_overrides_template => false,
docker_ce_package_name => 'docker',
}
To use the CE packages, add the following code to the manifest file:
class { 'docker':
use_upstream_package_source => false,
repo_opt => '',
}
By default, the Docker daemon binds to a unix socket at /var/run/docker.sock
. To change this parameter and update the binding parameter to a tcp socket, add the following code to the manifest file:
class { 'docker':
tcp_bind => ['tcp://127.0.0.1:2375'],
socket_bind => 'unix:///var/run/docker.sock',
ip_forward => true,
iptables => true,
ip_masq => true,
bip => '192.168.1.1/24',
fixed_cidr => '192.168.1.144/28',
}
For more information about the configuration options for the default docker bridge, see the Docker documentation.
The default group ownership of the Unix control socket differs based on OS. For example, on RHEL using docker-ce packages >=18.09.1, the socket file used by /usr/lib/systemd/system/docker.socket is owned by the docker group. To override this value in /etc/sysconfig/docker and docker.socket (e.g. to use the 'root' group):
class {'docker':
socket_group => 'root',
socket_override => true,
}
The socket_group parameter also takes a boolean for legacy cases where setting -G in /etc/sysconfig/docker is not desired:
docker::socket_group: false
To add another service to the After= line in the [Unit] section of the systemd /etc/systemd/system/service-overrides.conf file, use the service_after_override parameter:
docker::service_after_override: containerd.service
When setting up TLS, upload the related files (CA certificate, server certificate, and key) and include their paths in the manifest file:
class { 'docker':
tcp_bind => ['tcp://0.0.0.0:2376'],
tls_enable => true,
tls_cacert => '/etc/docker/tls/ca.pem',
tls_cert => '/etc/docker/tls/cert.pem',
tls_key => '/etc/docker/tls/key.pem',
}
To specify which Docker rpm package to install, add the following code to the manifest file:
class { 'docker':
manage_package => true,
use_upstream_package_source => false,
package_engine_name => 'docker-engine'
package_source_location => 'https://get.docker.com/rpm/1.7.0/centos-6/RPMS/x86_64/docker-engine-1.7.0-1.el6.x86_64.rpm',
prerequired_packages => [ 'glibc.i686', 'glibc.x86_64', 'sqlite.i686', 'sqlite.x86_64', 'device-mapper', 'device-mapper-libs', 'device-mapper-event-libs', 'device-mapper-event' ]
}
To track the latest version of Docker, add the following code to the manifest file:
class { 'docker':
version => 'latest',
}
To install docker from a test or edge channel, add the following code to the manifest file:
class { 'docker':
docker_ce_channel => 'test'
}
To allocate a dns server to the Docker daemon, add the following code to the manifest file:
class { 'docker':
dns => '8.8.8.8',
}
To add users to the Docker group, add the following array to the manifest file:
class { 'docker':
docker_users => ['user1', 'user2'],
}
To add daemon labels, add the following array to the manifest file:
class { 'docker':
labels => ['storage=ssd','stage=production'],
}
To pass additional parameters to the daemon, add extra_parameters
to the manifest file:
class { 'docker':
extra_parameters => ['--experimental=true', '--metrics-addr=localhost:9323'],
To uninstall docker, add the following to the manifest file:
class { 'docker':
ensure => absent
}
Only Docker EE is supported on Windows. To install docker on Windows 2016 and above the docker_ee
parameter must be specified:
class { 'docker':
docker_ee => true
}
Proxy on Windows
To use docker through a proxy on Windows, a System Environment Variable HTTP_PROXY/HTTPS_PROXY must be set. See Docker Engine on Windows This can be done using a different puppet module such as the puppet-windows_env module. After setting the variable, the docker service must be restarted.
windows_env { 'HTTP_PROXY'
value => 'http://1.2.3.4:80',
notify => Service['docker'],
}
windows_env { 'HTTPS_PROXY'
value => 'http://1.2.3.4:80',
notify => Service['docker'],
}
service { 'docker'
ensure => 'running',
}
Validating and unit testing the module
This module is compliant with the Puppet Development Kit (PDK), which provides tools to help run unit tests on the module and validate the modules's metadata, syntax, and style.
To run all validations against this module, run the following command:
pdk validate
To change validation behavior, add options flags to the command. For a complete list of command options and usage information, see the PDK command reference.
To unit test the module, run the following command:
pdk test unit
To change unit test behavior, add option flags to the command. For a complete list of command options and usage information, see the PDK command reference.
Usage
Images
Each image requires a unique name; otherwise, the installation fails when a duplicate name is detected.
To install a Docker image, add the docker::image
defined type to the manifest file:
docker::image { 'base': }
The code above is equivalent to running the docker pull base
command. However, it removes the default five-minute execution timeout.
To include an optional parameter for installing image tags that is the equivalent to running docker pull -t="precise" ubuntu
, add the following code to the manifest file:
docker::image { 'ubuntu':
image_tag => 'precise'
}
Including the docker_file
parameter is equivalent to running the docker build -t ubuntu - < /tmp/Dockerfile
command. To add or build an image from a dockerfile that includes the docker_file
parameter, add the following code to the manifest file:
docker::image { 'ubuntu':
docker_file => '/tmp/Dockerfile'
}
Including the docker_dir
parameter is equivalent to running the docker build -t ubuntu /tmp/ubuntu_image
command. To add or build an image from a dockerfile that includes the docker_dir
parameter, add the following code to the manifest file:
docker::image { 'ubuntu':
docker_dir => '/tmp/ubuntu_image'
}
To rebuild an image, subscribe to external events such as Dockerfile changes by adding the following code to the manifest file:
docker::image { 'ubuntu':
docker_file => '/tmp/Dockerfile'
subscribe => File['/tmp/Dockerfile'],
}
file { '/tmp/Dockerfile':
ensure => file,
source => 'puppet:///modules/someModule/Dockerfile',
}
To remove an image, add the following code to the manifest file:
docker::image { 'base':
ensure => 'absent'
}
docker::image { 'ubuntu':
ensure => 'absent',
image_tag => 'precise'
}
To configure the docker::images
class when using Hiera, add the following code to the manifest file:
---
classes:
- docker::images
docker::images::images:
ubuntu:
image_tag: 'precise'
Containers
To launch containers, add the following code to the manifest file:
docker::run { 'helloworld':
image => 'base',
command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"',
}
This is equivalent to running the docker run -d base /bin/sh -c "while true; do echo hello world; sleep 1; done"
command to launch a Docker container managed by the local init system.
run
includes a number of optional parameters:
docker::run { 'helloworld':
image => 'base',
detach => true,
service_prefix => 'docker-',
command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"',
ports => ['4444', '4555'],
expose => ['4666', '4777'],
links => ['mysql:db'],
net => ['my-user-def-net','my-user-def-net-2'],
disable_network => false,
volumes => ['/var/lib/couchdb', '/var/log'],
volumes_from => '6446ea52fbc9',
memory_limit => '10m', # (format: '<number><unit>', where unit = b, k, m or g)
cpuset => ['0', '3'],
username => 'example',
hostname => 'example.com',
env => ['FOO=BAR', 'FOO2=BAR2'],
env_file => ['/etc/foo', '/etc/bar'],
labels => ['com.example.foo="true"', 'com.example.bar="false"'],
dns => ['8.8.8.8', '8.8.4.4'],
restart_service => true,
privileged => false,
pull_on_start => false,
before_stop => 'echo "So Long, and Thanks for All the Fish"',
before_start => 'echo "Run this on the host before starting the Docker container"',
after => [ 'container_b', 'mysql' ],
depends => [ 'container_a', 'postgres' ],
stop_wait_time => 0,
read_only => false,
extra_parameters => [ '--restart=always' ],
}
You can specify the ports
, expose
, env
, dns
, and volumes
values with a single string or an array.
To pull the image before it starts, specify the pull_on_start
parameter.
Use the detach
param to run container a container without the -a
flag. This is only required on systems without systemd
. This default is set in the params.pp based on the OS. Only override if you understand the consuquences and have a specific use case.
To execute a command before the container stops, specify the before_stop
parameter.
Adding the container name to the after
parameter to specify which containers start first, affects the generation of the init.d/systemd
script.
Add container dependencies to the depends
parameter. The container starts before this container and stops before the depended container. This affects the generation of the init.d/systemd
script. Use the depend_services
parameter to specify dependencies for general services, which are not Docker related, that start before this container.
The extra_parameters
parameter, which contains an array of command line arguments to pass to the docker run
command, is useful for adding additional or experimental options that the docker module currently does not support.
By default, automatic restarting of the service on failure is enabled by the service file for systemd based systems.
It's recommended that an image tag is used at all times with the docker::run
define type. If not, the latest image is used whether it's in a remote registry or installed on the server already by the docker::image
define type.
NOTE: As of v3.0.0, if the latest tag is used the image will be the latest at the time the of the initial puppet run. Any subsequent puppet runs will always reference the latest local image. Therefore, it's recommended that an alternative tag be used, or the image be removed before pulling latest again.
To use an image tag, add the following code to the manifest file:
docker::run { 'helloworld':
image => 'ubuntu:precise',
command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"',
}
By default, when the service stops or starts, the generated init scripts remove the container, but not the associated volumes. To change this behaviour, add the following code to the manifest file:
docker::run { 'helloworld':
remove_container_on_start => true,
remove_volume_on_start => false,
remove_container_on_stop => true,
remove_volume_on_stop => false,
}
If using Hiera, you can configure the docker::run_instance
class:
---
classes:
- docker::run_instance
docker::run_instance::instance:
helloworld:
image: 'ubuntu:precise'
command: '/bin/sh -c "while true; do echo hello world; sleep 1; done"'
To remove a running container, add the following code to the manifest file. This also removes the systemd service file associated with the container.
docker::run { 'helloworld':
ensure => absent,
}
To enable the restart of an unhealthy container, add the following code to the manifest file. In order to set the health check interval time set the optional health_check_interval parameter, the default health check interval is 30 seconds.
docker::run { 'helloworld':
image => 'base',
command => 'command',
health_check_cmd => '<command_to_execute_to_check_your_containers_health>',
restart_on_unhealthy => true,
health_check_interval => '<time between running docker healthcheck>',
To run command on Windows 2016 requires the restart
parameter to be set:
docker::run { 'helloworld':
image => 'microsoft/nanoserver',
command => 'ping 127.0.0.1 -t',
restart => 'always'
Networks
Docker 1.9.x supports networks. To expose the docker_network
type that is used to manage networks, add the following code to the manifest file:
docker_network { 'my-net':
ensure => present,
driver => 'overlay',
subnet => '192.168.1.0/24',
gateway => '192.168.1.1',
ip_range => '192.168.1.4/32',
}
The name value and the ensure
parameter are required. If you do not include the driver
value, the default bridge is used. The Docker daemon must be configured for some networks and configuring the cluster store for the overlay network would be an example.
To configure the cluster store, update the docker
class in the manifest file:
extra_parameters => '--cluster-store=<backend>://172.17.8.101:<port> --cluster-advertise=<interface>:2376'
If using Hiera, configure the docker::networks
class in the manifest file:
---
classes:
- docker::networks
docker::networks::networks:
local-docker:
ensure: 'present'
subnet: '192.168.1.0/24'
gateway: '192.168.1.1'
A defined network can be used on a docker::run
resource with the net
parameter.
Windows
On windows, only one NAT network is supported. To support multiple networks, Windows Server 2016 with KB4015217 is required. See Windows Container Network Drivers and Windows Container Networking.
The Docker daemon will create a default NAT network on the first start unless specified otherwise. To disable the network creation, use the parameter bridge => 'none'
when installing docker.
Volumes
Docker 1.9.x added support for volumes. These are NOT to be confused with the legacy volumes, now known as bind mounts
. To expose the docker_volume
type, which is used to manage volumes, add the following code to the manifest file:
docker_volume { 'my-volume':
ensure => present,
}
You can pass additional mount options to the local
driver. For mounting an NFS export, use:
docker_volume { 'nfs-volume':
ensure => present,
driver => 'local',
options => {
type => 'nfs4',
o => 'addr=10.10.10.10,rw',
device => ':/exports/data'
},
}
The name value and the ensure
parameter are required. If you do not include the driver
value, the default local
is used.
If using Hiera, configure the docker::volumes
class in the manifest file:
---
classes:
- docker::volumes
docker::volumes:
blueocean:
ensure: present
driver: local
options:
type: "nfs"
o: "addr=%{custom_manager},rw",
device: ":/srv/blueocean"
Available parameters for options
depend on the used volume driver. For details, see
Using volumes from the Docker manual.
Some of the key advantages for using volumes
over bind mounts
are:
- Easier to back up or migrate rather than
bind mounts
(legacy volumes). - Managed with Docker CLI or API (Puppet type uses the CLI commands).
- Works on Windows and Linux.
- Easily shared between containers.
- Allows for store volumes on remote hosts or cloud providers.
- Encrypt contents of volumes.
- Add other functionality
- New volume's contents can be pre-populated by a container.
When using the volumes
array with docker::run
, the command on the backend will know if it needs to use bind mounts
or volumes
based off the data passed to the -v
option.
Running docker::run
with native volumes:
docker::run { 'helloworld':
image => 'ubuntu:precise',
command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"',
volumes => ['my-volume:/var/log'],
}
Compose
Docker Compose describes a set of containers in YAML format and runs a command to build and run those containers. Included in the docker module is the docker_compose
type. This enables Puppet to run Compose and remediate any issues to ensure reality matches the model in your Compose file.
Before you use the docker_compose
type, you must install the Docker Compose utility.
To install Docker Compose, add the following code to the manifest file:
class {'docker::compose':
ensure => present,
version => '1.9.0',
}
Set the version
parameter to any version you need to install.
This is an example of a Compose file:
compose_test:
image: ubuntu:14.04
command: /bin/sh -c "while true; do echo hello world; sleep 1; done"
Specify the file
resource to add a Compose file to the machine you have Puppet running on. To define a docker_compose
resource pointing to the Compose file, add the following code to the manifest file:
docker_compose { 'test':
compose_files => ['/tmp/docker-compose.yml'],
ensure => present,
}
Puppet automatically runs Compose, because the relevant Compose services aren't running. If required, include additional options such as enabling experimental features and scaling rules.
In the example below, Puppet runs Compose when the number of containers specified for a service doesn't match the scale values.
docker_compose { 'test':
compose_files => ['/tmp/docker-compose.yml'],
ensure => present,
scale => {
'compose_test' => 2,
},
options => '--x-networking'
}
Give options to the docker-compose up
command, such as --remove-orphans
, by using the up_args
option.
To supply multiple overide compose files add the following to the manifest file:
docker_compose {'test':
compose_files => ['master-docker-compose.yml', 'override-compose.yml'],
}
Please note you should supply your master docker-compose file as the first element in the array. As per docker, multi compose file support compose files are merged in the order they are specified in the array.
If you are using a v3.2 compose file or above on a Docker Swarm cluster, use the docker::stack
class. Include the file resource before you run the stack command.
NOTE: this define will be deprecated in a future release in favor of the docker stack type
To deploy the stack, add the following code to the manifest file:
docker::stack { 'yourapp':
ensure => present,
stack_name => 'yourapp',
compose_files => ['/tmp/docker-compose.yaml'],
require => [Class['docker'], File['/tmp/docker-compose.yaml']],
}
To remove the stack, set ensure => absent
.
If you are using a v3.2 compose file or above on a Docker Swarm cluster, include the docker::stack
class. Similar to using older versions of Docker, compose the file resource before running the stack command.
To deploy the stack, add the following code to the manifest file.
docker::stack { 'yourapp':
ensure => present,
stack_name => 'yourapp',
compose_files => ['/tmp/docker-compose.yaml'],
require => [Class['docker'], File['/tmp/docker-compose.yaml']],
}
To use use the equivalent type and provier, use the following in your manfiest file. For more information on specific parameters see the documentation for here
docker_stack { 'test':
compose_files => ['/tmp/docker-compose.yml'],
ensure => present,
}
To remove the stack, set ensure => absent
.
Machine
You can use Docker Machine to install Docker Engine on virtual hosts, and manage the hosts with docker-machine commands. You can also use Machine to create Docker hosts on your local Mac or Windows box, on your company network, in your data center, or on cloud providers like Azure, AWS, or Digital Ocean.
For more information on machines, see the Docker Machines documentation.
This module only installs the Docker Machine utility.
To install Docker Machine, add the following code to the manifest file:
class {'docker::machine':
ensure => present,
version => '1.16.1',
}
Set the version
parameter to any version you need to install.
Swarm mode
To natively manage a cluster of Docker Engines known as a swarm, Docker Engine 1.12 includes a swarm mode.
To cluster your Docker engines, use one of the following Puppet resources:
Windows
To configure swarm, Windows Server 2016 requires KB4015217 and the following firewall ports to be open on all nodes:
- TCP port 2377 for cluster management communications
- TCP and UDP port 7946 for communication among nodes
- UDP port 4789 for overlay network traffic
Swarm manager
To configure the swarm manager, add the following code to the manifest file:
docker::swarm {'cluster_manager':
init => true,
advertise_addr => '192.168.1.1',
listen_addr => '192.168.1.1',
}
For a multihomed server and to enable cluster communications between the node, include the advertise_addr
and listen_addr
parameters.
Swarm worker
To configure the swarm worker, add the following code to the manifest file:
docker::swarm {'cluster_worker':
join => true,
advertise_addr => '192.168.1.2',
listen_addr => '192.168.1.2',
manager_ip => '192.168.1.1',
token => 'your_join_token'
}
To configure a worker node or a second manager, include the swarm manager IP address in the manager_ip
parameter. To define the role of the node in the cluster, include the token
parameter. When creating an additional swarm manager and a worker node, separate tokens are required.
To remove a node from a cluster, add the following code to the manifest file:
docker::swarm {'cluster_worker':
ensure => absent
}
Tasks
The docker module has an example task that allows a user to initialize, join and leave a swarm.
bolt task run docker::swarm_init listen_addr=172.17.10.101 adverstise_addr=172.17.10.101 ---nodes swarm-master --user <user> --password <password> --modulepath <module_path>
docker swarm init --advertise-addr=172.17.10.101 --listen-addr=172.17.10.101
Swarm initialized: current node (w8syk0g286vd7d9kwzt7jl44z) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-317gw63odq6w1foaw0xkibzqy34lga55aa5nbjlqekcrhg8utl-08vrg0913zken8h9vfo4t6k0t 172.17.10.101:2377
To add a manager to this swarm, run docker swarm join-token manager
and follow the instructions.
Ran on 1 node in 4.04 seconds
bolt task run docker::swarm_token node_role=worker ---nodes swarm-master --user <user> --password <password> --modulepath <module_path>
SWMTKN-1-317gw63odq6w1foaw0xkibzqy34lga55aa5nbjlqekcrhg8utl-08vrg0913zken8h9vfo4t6k0t
Ran on 1 node in 4.02 seconds
bolt task run docker::swarm_join listen_addr=172.17.10.102 adverstise_addr=172.17.10.102 token=<swarm_token> manager_ip=172.17.10.101:2377 --nodes swarm-02 --user root --password puppet --modulepath /tmp/modules
This node joined a swarm as a worker.
Ran on 1 node in 4.68 seconds
bolt task run docker::swarm_leave --nodes swarm-02 --user root --password puppet --modulepath --modulepath <module_path>
Node left the swarm.
Ran on 1 node in 6.16 seconds
Docker services
Docker services create distributed applications across multiple swarm nodes. Each Docker service replicates a set of containers across the swarm.
To create a Docker service, add the following code to the manifest file:
docker::services {'redis':
create => true,
service_name => 'redis',
image => 'redis:latest',
publish => '6379:639',
replicas => '5',
mounts => ['type=bind,source=/etc/my-redis.conf,target=/etc/redis/redis.conf,readonly'],
extra_params => ['--update-delay 1m', '--restart-window 30s'],
command => ['redis-server', '--appendonly', 'yes'],
}
To base the service off an image, include the image
parameter and include the publish
parameter to expose the service port (use an array to specify multiple published ports). To set the amount of containers running in the service, include the replicas
parameter. To attach one or multiple filesystems to the service, use the mounts
parameter. For information regarding the extra_params
parameter, see docker service create --help
. The command
parameter can either be specified as an array or a string.
To update the service, add the following code to the manifest file:
docker::services {'redis_update':
create => false,
update => true,
service_name => 'redis',
replicas => '3',
}
To update a service without creating a new one, include the the update => true
parameter and the create => false
parameter.
To scale a service, add the following code to the manifest file:
docker::services {'redis_scale':
create => false,
scale => true,
service_name => 'redis',
replicas => '10',
}
To scale the service without creating a new one, include the the scale => true
parameter and the create => false
parameter. In the example above, the service is scaled to 10.
To remove a service, add the following code to the manifest file:
docker::services {'redis':
create => false,
ensure => 'absent',
service_name => 'redis',
}
To remove the service from a swarm, include the ensure => absent
parameter and the service_name
parameter.
Private registries
When a server is not specified, images are pushed and pulled from index.docker.io. To qualify your image name, create a private repository without authentication.
To configure authentication for a private registry, add the following code to the manifest file, depending on what version of Docker you are running. If you are using Docker V1.10 or earlier, specify the docker version in the manifest file:
docker::registry { 'example.docker.io:5000':
username => 'user',
password => 'secret',
email => 'user@example.com',
version => '<docker_version>'
}
To pull images from the docker store, use the following as the registry definition with your own docker hub credentials
docker::registry {'https://index.docker.io/v1/':
username => 'username',
password => 'password',
}
If using hiera, configure the docker::registry_auth
class:
docker::registry_auth::registries:
'example.docker.io:5000':
username: 'user1'
password: 'secret'
email: 'user1@example.io'
version: '<docker_version>'
If using Docker V1.11 or later, the docker login email flag has been deprecated. See the docker_change_log.
Add the following code to the manifest file:
docker::registry { 'example.docker.io:5000':
username => 'user',
password => 'secret',
}
If using hiera, configure the 'docker::registry_auth' class:
docker::registry_auth::registries:
'example.docker.io:5000':
username: 'user1'
password: 'secret'
To log out of a registry, add the following code to the manifest file:
docker::registry { 'example.docker.io:5000':
ensure => 'absent',
}
To set a preferred registry mirror, add the following code to the manifest file:
class { 'docker':
registry_mirror => 'http://testmirror.io'
}
Exec
Within the context of a running container, the docker module supports arbitrary commands:
docker::exec { 'cron_allow_root':
detach => true,
container => 'mycontainer',
command => '/bin/echo root >> /usr/lib/cron/cron.allow',
onlyif => 'running',
tty => true,
env => ['FOO=BAR', 'FOO2=BAR2'],
unless => 'grep root /usr/lib/cron/cron.allow 2>/dev/null',
refreshonly => true,
}
Plugin
The module supports the installation of Docker plugins:
docker::plugin {'foo/fooplugin:latest':
settings => ['VAR1=test','VAR2=value']
}
To disable an active plugin:
docker::plugin {'foo/fooplugin:latest':
enabled => false,
}
To remove an active plugin:
docker::plugin {'foo/fooplugin:latest'
ensure => 'absent',
force_remove => true,
}
Reference
For information on classes, types and functions see the REFERENCE.md.
Limitations
This module supports:
- Centos 7.0
- Debian 8.0
- Debian 9.0
- RedHat 7.0
- Ubuntu 14.04
- Ubuntu 16.04
- Ubuntu 18.04
- Windows Server 2016 (Docker Enterprise Edition only)
Development
If you would like to contribute to this module, see the guidelines in CONTRIBUTING.MD.
Reference
Table of Contents
Classes
docker
:docker::compose
:docker::config
: == Class: docker::configdocker::images
: docker::imagesdocker::install
:docker::machine
: == Class: docker::machine Class to install Docker Machine using the recommended curl command. === Parameters [ensure] Whether to instadocker::networks
: docker::networksdocker::params
: == Class: docker::params Default parameter values for the docker moduledocker::plugins
: docker::pluginsdocker::registry_auth
: docker::registry_authdocker::repos
: == Class: docker::reposdocker::run_instance
: docker::run_instancedocker::service
: == Class: docker::service Class to manage the docker service daemon === Parameters [tcp_bind] Which tcp port, if any, to bind the dockedocker::swarms
: docker::swarmsdocker::systemd_reload
: == Class: docker::systemd_reload For systems that have systemddocker::volumes
: docker::volumes
Defined types
docker::exec
: A define which executes a command inside a container.docker::image
: == Class: docker Module to install an up-to-date version of a Docker image from the registry === Parameters [ensure] Whether you want tdocker::plugin
:docker::registry
: == Class: docker Module to configure private docker registries from which to pull Docker images If the registry does not require authenticatdocker::run
: == Define: docker:run A define which manages a running docker container. == Parameters [restart] Sets a restart policy on the docker rundocker::secrets
: == Define: docker::secretsdocker::services
:docker::stack
:docker::swarm
:docker::system_user
: == Define: docker::system_user Define to manage docker group users === Parameters [create_user] Boolean to cotrol whether the user shoudocker::windows_account
: == Define: docker::windows_account Define the Windows account that owns the docker services
Resource types
docker_compose
: A type representing a Docker Compose filedocker_network
: Type representing a Docker networkdocker_stack
: A type representing a Docker Stackdocker_volume
: A type representing a Docker volume
Functions
docker::sanitised_name
: == Function: docker::sanitised_name Function to sanitise container name. === Parameters [name] Name to sanitisedocker_exec_flags
: Transforms a hash into a string of docker exec flagsdocker_plugin_enable_flags
: Transforms a hash into a string of docker plugin remove flagsdocker_plugin_install_flags
: Transforms a hash into a string of docker plugin install flagsdocker_plugin_remove_flags
: Transforms a hash into a string of docker plugin remove flagsdocker_run_flags
: Transforms a hash into a string of docker flagsdocker_secrets_flags
: Transforms a hash into a string of docker swarm init flagsdocker_service_flags
: Transforms a hash into a string of docker swarm init flagsdocker_stack_flags
: Transforms a hash into a string of docker stack flagsdocker_swarm_init_flags
: Transforms a hash into a string of docker swarm init flagsdocker_swarm_join_flags
: Transforms a hash into a string of docker swarm init flags
Tasks
node_ls
: List nodes in the swarmnode_rm
: Update a nodenode_update
: Update a nodeservice_scale
: Scale one replicated serviceswarm_init
: Initializes a swarmswarm_join
: Join a swarmswarm_leave
: Leave a swarmswarm_token
: Gets the swarm token from the masterswarm_update
: Updates an existing service.
Classes
docker
The docker class.
Parameters
The following parameters are available in the docker
class.
version
Data type: Optional[String]
Default value: $docker::params::version
ensure
Data type: String
Default value: $docker::params::ensure
prerequired_packages
Data type: Variant[Array[String], Hash]
Default value: $docker::params::prerequired_packages
dependent_packages
Data type: Array
Default value: $docker::params::dependent_packages
docker_ce_start_command
Data type: String
Default value: $docker::params::docker_ce_start_command
docker_ce_package_name
Data type: Optional[String]
Default value: $docker::params::docker_ce_package_name
docker_ce_source_location
Data type: Optional[String]
Default value: $docker::params::package_ce_source_location
docker_ce_key_source
Data type: Optional[String]
Default value: $docker::params::package_ce_key_source
docker_ce_key_id
Data type: Optional[String]
Default value: $docker::params::package_ce_key_id
docker_ce_release
Data type: Optional[String]
Default value: $docker::params::package_ce_release
docker_package_location
Data type: Optional[String]
Default value: $docker::params::package_source_location
docker_package_key_source
Data type: Optional[String]
Default value: $docker::params::package_key_source
docker_package_key_check_source
Data type: Optional[Boolean]
Default value: $docker::params::package_key_check_source
docker_package_key_id
Data type: Optional[String]
Default value: $docker::params::package_key_id
docker_package_release
Data type: Optional[String]
Default value: $docker::params::package_release
docker_engine_start_command
Data type: String
Default value: $docker::params::docker_engine_start_command
docker_engine_package_name
Data type: String
Default value: $docker::params::docker_engine_package_name
docker_ce_channel
Data type: String
Default value: $docker::params::docker_ce_channel
docker_ee
Data type: Optional[Boolean]
Default value: $docker::params::docker_ee
docker_ee_package_name
Data type: Optional[String]
Default value: $docker::params::package_ee_package_name
docker_ee_source_location
Data type: Optional[String]
Default value: $docker::params::package_ee_source_location
docker_ee_key_source
Data type: Optional[String]
Default value: $docker::params::package_ee_key_source
docker_ee_key_id
Data type: Optional[String]
Default value: $docker::params::package_ee_key_id
docker_ee_repos
Data type: Optional[String]
Default value: $docker::params::package_ee_repos
docker_ee_release
Data type: Optional[String]
Default value: $docker::params::package_ee_release
tcp_bind
Data type: Variant[String,Array[String],Undef]
Default value: $docker::params::tcp_bind
tls_enable
Data type: Boolean
Default value: $docker::params::tls_enable
tls_verify
Data type: Boolean
Default value: $docker::params::tls_verify
tls_cacert
Data type: Optional[String]
Default value: $docker::params::tls_cacert
tls_cert
Data type: Optional[String]
Default value: $docker::params::tls_cert
tls_key
Data type: Optional[String]
Default value: $docker::params::tls_key
ip_forward
Data type: Boolean
Default value: $docker::params::ip_forward
ip_masq
Data type: Boolean
Default value: $docker::params::ip_masq
ipv6
Data type: Optional[Boolean]
Default value: $docker::params::ipv6
ipv6_cidr
Data type: Optional[String]
Default value: $docker::params::ipv6_cidr
default_gateway_ipv6
Data type: Optional[String]
Default value: $docker::params::default_gateway_ipv6
bip
Data type: Optional[String]
Default value: $docker::params::bip
mtu
Data type: Optional[String]
Default value: $docker::params::mtu
iptables
Data type: Boolean
Default value: $docker::params::iptables
icc
Data type: Optional[Boolean]
Default value: $docker::params::icc
socket_bind
Data type: String
Default value: $docker::params::socket_bind
fixed_cidr
Data type: Optional[String]
Default value: $docker::params::fixed_cidr
bridge
Data type: Optional[String]
Default value: $docker::params::bridge
default_gateway
Data type: Optional[String]
Default value: $docker::params::default_gateway
log_level
Data type: Optional[String]
Default value: $docker::params::log_level
log_driver
Data type: Optional[String]
Default value: $docker::params::log_driver
log_opt
Data type: Array
Default value: $docker::params::log_opt
selinux_enabled
Data type: Optional[Boolean]
Default value: $docker::params::selinux_enabled
use_upstream_package_source
Data type: Optional[Boolean]
Default value: $docker::params::use_upstream_package_source
pin_upstream_package_source
Data type: Optional[Boolean]
Default value: $docker::params::pin_upstream_package_source
apt_source_pin_level
Data type: Optional[Integer]
Default value: $docker::params::apt_source_pin_level
package_release
Data type: Optional[String]
Default value: $docker::params::package_release
service_state
Data type: String
Default value: $docker::params::service_state
service_enable
Data type: Boolean
Default value: $docker::params::service_enable
manage_service
Data type: Boolean
Default value: $docker::params::manage_service
root_dir
Data type: Optional[String]
Default value: $docker::params::root_dir
tmp_dir_config
Data type: Optional[Boolean]
Default value: $docker::params::tmp_dir_config
tmp_dir
Data type: Optional[String]
Default value: $docker::params::tmp_dir
dns
Data type: Variant[String,Array,Undef]
Default value: $docker::params::dns
dns_search
Data type: Variant[String,Array,Undef]
Default value: $docker::params::dns_search
socket_group
Data type: Variant[String,Boolean,Undef]
Default value: $docker::params::socket_group
labels
Data type: Array
Default value: $docker::params::labels
extra_parameters
Data type: Variant[String,Array,Undef]
Default value: undef
shell_values
Data type: Variant[String,Array,Undef]
Default value: undef
proxy
Data type: Optional[String]
Default value: $docker::params::proxy
no_proxy
Data type: Optional[String]
Default value: $docker::params::no_proxy
storage_driver
Data type: Optional[String]
Default value: $docker::params::storage_driver
dm_basesize
Data type: Optional[String]
Default value: $docker::params::dm_basesize
dm_fs
Data type: Optional[String]
Default value: $docker::params::dm_fs
dm_mkfsarg
Data type: Optional[String]
Default value: $docker::params::dm_mkfsarg
dm_mountopt
Data type: Optional[String]
Default value: $docker::params::dm_mountopt
dm_blocksize
Data type: Optional[String]
Default value: $docker::params::dm_blocksize
dm_loopdatasize
Data type: Optional[String]
Default value: $docker::params::dm_loopdatasize
dm_loopmetadatasize
Data type: Optional[String]
Default value: $docker::params::dm_loopmetadatasize
dm_datadev
Data type: Optional[String]
Default value: $docker::params::dm_datadev
dm_metadatadev
Data type: Optional[String]
Default value: $docker::params::dm_metadatadev
dm_thinpooldev
Data type: Optional[String]
Default value: $docker::params::dm_thinpooldev
dm_use_deferred_removal
Data type: Optional[Boolean]
Default value: $docker::params::dm_use_deferred_removal
dm_use_deferred_deletion
Data type: Optional[Boolean]
Default value: $docker::params::dm_use_deferred_deletion
dm_blkdiscard
Data type: Optional[Boolean]
Default value: $docker::params::dm_blkdiscard
dm_override_udev_sync_check
Data type: Optional[Boolean]
Default value: $docker::params::dm_override_udev_sync_check
overlay2_override_kernel_check
Data type: Boolean
Default value: $docker::params::overlay2_override_kernel_check
execdriver
Data type: Optional[String]
Default value: $docker::params::execdriver
manage_package
Data type: Boolean
Default value: $docker::params::manage_package
package_source
Data type: Optional[String]
Default value: $docker::params::package_source
service_name
Data type: Optional[String]
Default value: $docker::params::service_name
docker_users
Data type: Array
Default value: []
docker_group
Data type: String
Default value: $docker::params::docker_group
daemon_environment_files
Data type: Array
Default value: []
repo_opt
Data type: Variant[String,Hash,Undef]
Default value: $docker::params::repo_opt
os_lc
Data type: Optional[String]
Default value: $docker::params::os_lc
storage_devs
Data type: Optional[String]
Default value: $docker::params::storage_devs
storage_vg
Data type: Optional[String]
Default value: $docker::params::storage_vg
storage_root_size
Data type: Optional[String]
Default value: $docker::params::storage_root_size
storage_data_size
Data type: Optional[String]
Default value: $docker::params::storage_data_size
storage_min_data_size
Data type: Optional[String]
Default value: $docker::params::storage_min_data_size
storage_chunk_size
Data type: Optional[String]
Default value: $docker::params::storage_chunk_size
storage_growpart
Data type: Optional[Boolean]
Default value: $docker::params::storage_growpart
storage_auto_extend_pool
Data type: Optional[String]
Default value: $docker::params::storage_auto_extend_pool
storage_pool_autoextend_threshold
Data type: Optional[String]
Default value: $docker::params::storage_pool_autoextend_threshold
storage_pool_autoextend_percent
Data type: Optional[String]
Default value: $docker::params::storage_pool_autoextend_percent
storage_config
Data type: Variant[String,Boolean,Undef]
Default value: $docker::params::storage_config
storage_config_template
Data type: Optional[String]
Default value: $docker::params::storage_config_template
storage_setup_file
Data type: Optional[String]
Default value: $docker::params::storage_setup_file
service_provider
Data type: Optional[String]
Default value: $docker::params::service_provider
service_config
Data type: Variant[String,Boolean,Undef]
Default value: $docker::params::service_config
service_config_template
Data type: Optional[String]
Default value: $docker::params::service_config_template
service_overrides_template
Data type: Variant[String,Boolean,Undef]
Default value: $docker::params::service_overrides_template
socket_overrides_template
Data type: Variant[String,Boolean,Undef]
Default value: $docker::params::socket_overrides_template
socket_override
Data type: Optional[Boolean]
Default value: $docker::params::socket_override
service_after_override
Data type: Variant[String,Boolean,Undef]
Default value: $docker::params::service_after_override
service_hasstatus
Data type: Optional[Boolean]
Default value: $docker::params::service_hasstatus
service_hasrestart
Data type: Optional[Boolean]
Default value: $docker::params::service_hasrestart
registry_mirror
Data type: Optional[String]
Default value: $docker::params::registry_mirror
acknowledge_unsupported_os
Data type: Boolean
Default value: false
docker_msft_provider_version
Data type: Optional[String]
Default value: $docker::params::docker_msft_provider_version
nuget_package_provider_version
Data type: Optional[String]
Default value: $docker::params::nuget_package_provider_version
docker::compose
The docker::compose class.
Parameters
The following parameters are available in the docker::compose
class.
ensure
Data type: Optional[Pattern[/^present$|^absent$/]]
Default value: 'present'
version
Data type: Optional[String]
Default value: $docker::params::compose_version
install_path
Data type: Optional[String]
Default value: $docker::params::compose_install_path
proxy
Data type: Optional[String]
Default value: undef
base_url
Data type: Optional[String]
Default value: $docker::params::compose_base_url
raw_url
Data type: Optional[String]
Default value: undef
docker::config
== Class: docker::config
docker::images
docker::images
Parameters
The following parameters are available in the docker::images
class.
images
Data type: Any
docker::install
The docker::install class.
Parameters
The following parameters are available in the docker::install
class.
version
Data type: Any
Default value: $docker::version
nuget_package_provider_version
Data type: Any
Default value: $docker::nuget_package_provider_version
docker_msft_provider_version
Data type: Any
Default value: $docker::docker_msft_provider_version
docker_ee_package_name
Data type: Any
Default value: $docker::docker_ee_package_name
docker_download_url
Data type: Any
Default value: $docker::package_location
dependent_packages
Data type: Any
Default value: $docker::dependent_packages
docker::machine
== Class: docker::machine
Class to install Docker Machine using the recommended curl command.
=== Parameters
[ensure] Whether to install or remove Docker Machine Valid values are absent present Defaults to present
[version] The version of Docker Machine to install. Defaults to the value set in $docker::params::machine_version
[install_path] The path where to install Docker Machine. Defaults to the value set in $docker::params::machine_install_path
[proxy] Proxy to use for downloading Docker Machine.
Parameters
The following parameters are available in the docker::machine
class.
ensure
Data type: Optional[Pattern[/^present$|^absent$/]]
Default value: 'present'
version
Data type: Optional[String]
Default value: $docker::params::machine_version
install_path
Data type: Optional[String]
Default value: $docker::params::machine_install_path
proxy
Data type: Optional[String]
Default value: undef
docker::networks
docker::networks
Parameters
The following parameters are available in the docker::networks
class.
networks
Data type: Any
docker::params
== Class: docker::params
Default parameter values for the docker module
docker::plugins
docker::plugins
Parameters
The following parameters are available in the docker::plugins
class.
plugins
Data type: Any
docker::registry_auth
docker::registry_auth
Parameters
The following parameters are available in the docker::registry_auth
class.
registries
Data type: Any
docker::repos
== Class: docker::repos
Parameters
The following parameters are available in the docker::repos
class.
location
Data type: Any
Default value: $docker::package_location
key_source
Data type: Any
Default value: $docker::package_key_source
key_check_source
Data type: Any
Default value: $docker::package_key_check_source
architecture
Data type: Any
Default value: $facts['architecture']
docker::run_instance
docker::run_instance
Parameters
The following parameters are available in the docker::run_instance
class.
instance
Data type: Any
docker::service
== Class: docker::service
Class to manage the docker service daemon
=== Parameters [tcp_bind] Which tcp port, if any, to bind the docker service to.
[ip_forward] This flag interacts with the IP forwarding setting on your host system's kernel
[iptables] Enable Docker's addition of iptables rules
[ip_masq] Enable IP masquerading for bridge's IP range.
[socket_bind] Which local unix socket to bind the docker service to.
[socket_group] Which local unix socket to bind the docker service to.
[root_dir] Specify a non-standard root directory for docker.
[extra_parameters] Plain additional parameters to pass to the docker daemon
[shell_values] Array of shell values to pass into init script config files
[manage_service] Specify whether the service should be managed. Valid values are 'true', 'false'. Defaults to 'true'.
Parameters
The following parameters are available in the docker::service
class.
docker_command
Data type: Any
Default value: $docker::docker_command
docker_start_command
Data type: Any
Default value: $docker::docker_start_command
service_name
Data type: Any
Default value: $docker::service_name
tcp_bind
Data type: Any
Default value: $docker::tcp_bind
ip_forward
Data type: Any
Default value: $docker::ip_forward
iptables
Data type: Any
Default value: $docker::iptables
ip_masq
Data type: Any
Default value: $docker::ip_masq
icc
Data type: Any
Default value: $docker::icc
bridge
Data type: Any
Default value: $docker::bridge
fixed_cidr
Data type: Any
Default value: $docker::fixed_cidr
default_gateway
Data type: Any
Default value: $docker::default_gateway
ipv6
Data type: Any
Default value: $docker::ipv6
ipv6_cidr
Data type: Any
Default value: $docker::ipv6_cidr
default_gateway_ipv6
Data type: Any
Default value: $docker::default_gateway_ipv6
socket_bind
Data type: Any
Default value: $docker::socket_bind
log_level
Data type: Any
Default value: $docker::log_level
log_driver
Data type: Any
Default value: $docker::log_driver
log_opt
Data type: Any
Default value: $docker::log_opt
selinux_enabled
Data type: Any
Default value: $docker::selinux_enabled
socket_group
Data type: Any
Default value: $docker::socket_group
labels
Data type: Any
Default value: $docker::labels
dns
Data type: Any
Default value: $docker::dns
dns_search
Data type: Any
Default value: $docker::dns_search
service_state
Data type: Any
Default value: $docker::service_state
service_enable
Data type: Any
Default value: $docker::service_enable
manage_service
Data type: Any
Default value: $docker::manage_service
root_dir
Data type: Any
Default value: $docker::root_dir
extra_parameters
Data type: Any
Default value: $docker::extra_parameters
shell_values
Data type: Any
Default value: $docker::shell_values
proxy
Data type: Any
Default value: $docker::proxy
no_proxy
Data type: Any
Default value: $docker::no_proxy
execdriver
Data type: Any
Default value: $docker::execdriver
bip
Data type: Any
Default value: $docker::bip
mtu
Data type: Any
Default value: $docker::mtu
storage_driver
Data type: Any
Default value: $docker::storage_driver
dm_basesize
Data type: Any
Default value: $docker::dm_basesize
dm_fs
Data type: Any
Default value: $docker::dm_fs
dm_mkfsarg
Data type: Any
Default value: $docker::dm_mkfsarg
dm_mountopt
Data type: Any
Default value: $docker::dm_mountopt
dm_blocksize
Data type: Any
Default value: $docker::dm_blocksize
dm_loopdatasize
Data type: Any
Default value: $docker::dm_loopdatasize
dm_loopmetadatasize
Data type: Any
Default value: $docker::dm_loopmetadatasize
dm_datadev
Data type: Any
Default value: $docker::dm_datadev
dm_metadatadev
Data type: Any
Default value: $docker::dm_metadatadev
tmp_dir_config
Data type: Any
Default value: $docker::tmp_dir_config
tmp_dir
Data type: Any
Default value: $docker::tmp_dir
dm_thinpooldev
Data type: Any
Default value: $docker::dm_thinpooldev
dm_use_deferred_removal
Data type: Any
Default value: $docker::dm_use_deferred_removal
dm_use_deferred_deletion
Data type: Any
Default value: $docker::dm_use_deferred_deletion
dm_blkdiscard
Data type: Any
Default value: $docker::dm_blkdiscard
dm_override_udev_sync_check
Data type: Any
Default value: $docker::dm_override_udev_sync_check
overlay2_override_kernel_check
Data type: Any
Default value: $docker::overlay2_override_kernel_check
storage_devs
Data type: Any
Default value: $docker::storage_devs
storage_vg
Data type: Any
Default value: $docker::storage_vg
storage_root_size
Data type: Any
Default value: $docker::storage_root_size
storage_data_size
Data type: Any
Default value: $docker::storage_data_size
storage_min_data_size
Data type: Any
Default value: $docker::storage_min_data_size
storage_chunk_size
Data type: Any
Default value: $docker::storage_chunk_size
storage_growpart
Data type: Any
Default value: $docker::storage_growpart
storage_auto_extend_pool
Data type: Any
Default value: $docker::storage_auto_extend_pool
storage_pool_autoextend_threshold
Data type: Any
Default value: $docker::storage_pool_autoextend_threshold
storage_pool_autoextend_percent
Data type: Any
Default value: $docker::storage_pool_autoextend_percent
storage_config
Data type: Any
Default value: $docker::storage_config
storage_config_template
Data type: Any
Default value: $docker::storage_config_template
storage_setup_file
Data type: Any
Default value: $docker::storage_setup_file
service_provider
Data type: Any
Default value: $docker::service_provider
service_config
Data type: Any
Default value: $docker::service_config
service_config_template
Data type: Any
Default value: $docker::service_config_template
service_overrides_template
Data type: Any
Default value: $docker::service_overrides_template
socket_overrides_template
Data type: Any
Default value: $docker::socket_overrides_template
socket_override
Data type: Any
Default value: $docker::socket_override
service_after_override
Data type: Any
Default value: $docker::service_after_override
service_hasstatus
Data type: Any
Default value: $docker::service_hasstatus
service_hasrestart
Data type: Any
Default value: $docker::service_hasrestart
daemon_environment_files
Data type: Any
Default value: $docker::daemon_environment_files
tls_enable
Data type: Any
Default value: $docker::tls_enable
tls_verify
Data type: Any
Default value: $docker::tls_verify
tls_cacert
Data type: Any
Default value: $docker::tls_cacert
tls_cert
Data type: Any
Default value: $docker::tls_cert
tls_key
Data type: Any
Default value: $docker::tls_key
registry_mirror
Data type: Any
Default value: $docker::registry_mirror
root_dir_flag
Data type: Any
Default value: $docker::root_dir_flag
docker::swarms
docker::swarms
Parameters
The following parameters are available in the docker::swarms
class.
swarms
Data type: Any
docker::systemd_reload
== Class: docker::systemd_reload
For systems that have systemd
docker::volumes
docker::volumes
Parameters
The following parameters are available in the docker::volumes
class.
volumes
Data type: Any
Defined types
docker::exec
A define which executes a command inside a container.
Parameters
The following parameters are available in the docker::exec
defined type.
detach
Data type: Optional[Boolean]
Default value: false
interactive
Data type: Optional[Boolean]
Default value: false
env
Data type: Optional[Array]
Default value: []
tty
Data type: Optional[Boolean]
Default value: false
container
Data type: Optional[String]
Default value: undef
command
Data type: Optional[String]
Default value: undef
unless
Data type: Optional[String]
Default value: undef
sanitise_name
Data type: Optional[Boolean]
Default value: true
refreshonly
Data type: Optional[Boolean]
Default value: false
onlyif
Data type: Optional[String]
Default value: undef
docker::image
== Class: docker
Module to install an up-to-date version of a Docker image from the registry
=== Parameters [ensure] Whether you want the image present or absent.
[image] If you want the name of the image to be different from the name of the puppet resource you can pass a value here.
[image_tag] If you want a specific tag of the image to be installed
[image_digest] If you want a specific content digest of the image to be installed
[docker_file] If you want to add a docker image from specific docker file
[docker_tar] If you want to load a docker image from specific docker tar
Parameters
The following parameters are available in the docker::image
defined type.
ensure
Data type: Optional[Pattern[/^(present|absent|latest)$/]]
Default value: 'present'
image
Data type: Optional[Pattern[/^[\S]*$/]]
Default value: $title
image_tag
Data type: Optional[String]
Default value: undef
image_digest
Data type: Optional[String]
Default value: undef
force
Data type: Optional[Boolean]
Default value: false
docker_file
Data type: Optional[String]
Default value: undef
docker_dir
Data type: Optional[String]
Default value: undef
docker_tar
Data type: Optional[String]
Default value: undef
docker::plugin
The docker::plugin class.
Parameters
The following parameters are available in the docker::plugin
defined type.
ensure
Data type: Optional[Pattern[/^present$|^absent$/]]
Default value: 'present'
plugin_name
Data type: String
Default value: $title
enabled
Data type: Optional[Boolean]
Default value: true
timeout
Data type: Optional[String]
Default value: undef
plugin_alias
Data type: Optional[String]
Default value: undef
disable_on_install
Data type: Optional[Boolean]
Default value: false
disable_content_trust
Data type: Optional[Boolean]
Default value: true
grant_all_permissions
Data type: Optional[Boolean]
Default value: true
force_remove
Data type: Optional[Boolean]
Default value: true
settings
Data type: Optional[Array]
Default value: []
docker::registry
== Class: docker
Module to configure private docker registries from which to pull Docker images If the registry does not require authentication, this module is not required.
=== Parameters [server] The hostname and port of the private Docker registry. Ex: dockerreg:5000
[ensure] Whether or not you want to login or logout of a repository
[username] Username for authentication to private Docker registry. auth is not required.
[password] Password for authentication to private Docker registry. Leave undef if auth is not required.
[pass_hash] The hash to be used for receipt. If left as undef, a hash will be generated
[email] Email for registration to private Docker registry. Leave undef if auth is not required.
[local_user] The local user to log in as. Docker will store credentials in this users home directory
[receipt] Required to be true for idempotency
Parameters
The following parameters are available in the docker::registry
defined type.
server
Data type: Optional[String]
Default value: $title
ensure
Data type: Optional[Pattern[/^present$|^absent$/]]
Default value: 'present'
username
Data type: Optional[String]
Default value: undef
password
Data type: Optional[String]
Default value: undef
pass_hash
Data type: Optional[String]
Default value: undef
email
Data type: Optional[String]
Default value: undef
local_user
Data type: Optional[String]
Default value: 'root'
version
Data type: Optional[String]
Default value: $docker::version
receipt
Data type: Optional[Boolean]
Default value: true
docker::run
== Define: docker:run
A define which manages a running docker container.
== Parameters
[restart] Sets a restart policy on the docker run. Note: If set, puppet will NOT setup an init script to manage, instead it will do a raw docker run command using a CID file to track the container ID.
If you want a normal named container with an init script and a restart policy you must use the extra_parameters feature and pass it in like this:
extra_parameters => ['--restart=always']
However, if your system is using sytemd this restart policy will be ineffective because the ExecStop commands will run which will cause docker to stop restarting it. In this case you should use the systemd_restart option to specify the policy you want.
This will allow the docker container to be restarted if it dies, without puppet help.
[service_prefix] (optional) The name to prefix the startup script with and the Puppet service resource title with. Default: 'docker-'
[restart_service] (optional) Whether or not to restart the service if the the generated init script changes. Default: true
[restart_service_on_docker_refresh] Whether or not to restart the service if the docker service is restarted. Only has effect if the docker_service parameter is set. Default: true
[manage_service] (optional) Whether or not to create a puppet Service resource for the init script. Disabling this may be useful if integrating with existing modules. Default: true
[docker_service] (optional) If (and how) the Docker service itself is managed by Puppet true -> Service['docker'] false -> no Service dependency anything else -> Service[docker_service] Default: false
[health_check_cmd] (optional) Specifies the command to execute to check that the container is healthy using the docker health check functionality. Default: undef
[health_check_interval] (optional) Specifies the interval that the health check command will execute in seconds. Default: undef
[restart_on_unhealthy] (optional) Checks the health status of Docker container and if it is unhealthy the service will be restarted. The health_check_cmd parameter must be set to true to use this functionality. Default: undef
[net]
The docker network to attach to a container. Can be a String or Array (if using multiple networks) Default: bridge
[extra_parameters]
An array of additional command line arguments to pass to the docker run
command. Useful for adding additional new or experimental options that the
module does not yet support.
[systemd_restart] (optional) If the container is to be managed by a systemd unit file set the Restart option on the unit file. Can be any valid value for this systemd configuration. Most commonly used are on-failure or always. Default: on-failure
[custom_unless] (optional) Specify an additional unless for the Docker run command when using restart. Default: undef
[after_create] (optional) Specifies the command to execute after container is created but before it is started. Default: undef
Parameters
The following parameters are available in the docker::run
defined type.
image
Data type: Optional[Pattern[/^[\S]*$/]]
ensure
Data type: Optional[Pattern[/^present$|^absent$/]]
Default value: 'present'
command
Data type: Optional[String]
Default value: undef
memory_limit
Data type: Optional[Pattern[/^[\d]*(b|k|m|g)$/]]
Default value: '0b'
cpuset
Data type: Variant[String,Array,Undef]
Default value: []
ports
Data type: Variant[String,Array,Undef]
Default value: []
labels
Data type: Variant[String,Array,Undef]
Default value: []
expose
Data type: Variant[String,Array,Undef]
Default value: []
volumes
Data type: Variant[String,Array,Undef]
Default value: []
links
Data type: Variant[String,Array,Undef]
Default value: []
use_name
Data type: Optional[Boolean]
Default value: false
running
Data type: Optional[Boolean]
Default value: true
volumes_from
Data type: Variant[String,Array,Undef]
Default value: []
net
Data type: Variant[String,Array]
Default value: 'bridge'
username
Data type: Variant[String,Boolean]
Default value: false
hostname
Data type: Variant[String,Boolean]
Default value: false
env
Data type: Variant[String,Array,Undef]
Default value: []
env_file
Data type: Variant[String,Array,Undef]
Default value: []
dns
Data type: Variant[String,Array,Undef]
Default value: []
dns_search
Data type: Variant[String,Array,Undef]
Default value: []
lxc_conf
Data type: Variant[String,Array,Undef]
Default value: []
service_prefix
Data type: Optional[String]
Default value: 'docker-'
service_provider
Data type: Optional[String]
Default value: undef
restart_service
Data type: Optional[Boolean]
Default value: true
restart_service_on_docker_refresh
Data type: Optional[Boolean]
Default value: true
manage_service
Data type: Optional[Boolean]
Default value: true
docker_service
Data type: Variant[String,Boolean]
Default value: false
disable_network
Data type: Optional[Boolean]
Default value: false
privileged
Data type: Optional[Boolean]
Default value: false
detach
Data type: Optional[Boolean]
Default value: undef
extra_parameters
Data type: Variant[String,Array[String],Undef]
Default value: undef
systemd_restart
Data type: Optional[String]
Default value: 'on-failure'
extra_systemd_parameters
Data type: Variant[String,Hash,Undef]
Default value: {}
pull_on_start
Data type: Optional[Boolean]
Default value: false
after
Data type: Variant[String,Array,Undef]
Default value: []
after_service
Data type: Variant[String,Array,Undef]
Default value: []
depends
Data type: Variant[String,Array,Undef]
Default value: []
depend_services
Data type: Variant[String,Array,Undef]
Default value: []
tty
Data type: Optional[Boolean]
Default value: false
socket_connect
Data type: Variant[String,Array,Undef]
Default value: []
hostentries
Data type: Variant[String,Array,Undef]
Default value: []
restart
Data type: Optional[String]
Default value: undef
before_start
Data type: Variant[String,Boolean]
Default value: false
before_stop
Data type: Variant[String,Boolean]
Default value: false
after_create
Data type: Optional[String]
Default value: undef
remove_container_on_start
Data type: Optional[Boolean]
Default value: true
remove_container_on_stop
Data type: Optional[Boolean]
Default value: true
remove_volume_on_start
Data type: Optional[Boolean]
Default value: false
remove_volume_on_stop
Data type: Optional[Boolean]
Default value: false
stop_wait_time
Data type: Optional[Integer]
Default value: 0
syslog_identifier
Data type: Optional[String]
Default value: undef
read_only
Data type: Optional[Boolean]
Default value: false
health_check_cmd
Data type: Optional[String]
Default value: undef
restart_on_unhealthy
Data type: Optional[Boolean]
Default value: false
health_check_interval
Data type: Optional[Integer]
Default value: undef
custom_unless
Data type: Variant[String,Array,Undef]
Default value: []
docker::secrets
== Define: docker::secrets
Parameters
The following parameters are available in the docker::secrets
defined type.
ensure
Data type: Optional[Pattern[/^present$|^absent$/]]
Default value: 'present'
label
Data type: Variant[String,Array,Undef]
Default value: []
secret_name
Data type: Optional[String]
Default value: undef
secret_path
Data type: Optional[String]
Default value: undef
docker::services
The docker::services class.
Parameters
The following parameters are available in the docker::services
defined type.
ensure
Data type: Optional[Pattern[/^present$|^absent$/]]
Default value: 'present'
create
Data type: Optional[Boolean]
Default value: true
update
Data type: Optional[Boolean]
Default value: false
scale
Data type: Optional[Boolean]
Default value: false
detach
Data type: Optional[Boolean]
Default value: true
tty
Data type: Optional[Boolean]
Default value: false
env
Data type: Optional[Array]
Default value: []
label
Data type: Optional[Array]
Default value: []
extra_params
Data type: Optional[Array]
Default value: []
image
Data type: Variant[String,Array,Undef]
Default value: undef
service_name
Data type: Variant[String,Array,Undef]
Default value: undef
publish
Data type: Variant[String,Array,Undef]
Default value: undef
replicas
Data type: Variant[String,Array,Undef]
Default value: undef
user
Data type: Variant[String,Array,Undef]
Default value: undef
workdir
Data type: Variant[String,Array,Undef]
Default value: undef
host_socket
Data type: Variant[String,Array,Undef]
Default value: undef
registry_mirror
Data type: Variant[String,Array,Undef]
Default value: undef
mounts
Data type: Variant[String,Array,Undef]
Default value: undef
networks
Data type: Variant[Array,Undef]
Default value: undef
command
Data type: Variant[String,Array,Undef]
Default value: undef
docker::stack
The docker::stack class.
Parameters
The following parameters are available in the docker::stack
defined type.
ensure
Data type: Optional[Pattern[/^present$|^absent$/]]
Default value: 'present'
stack_name
Data type: Optional[String]
Default value: undef
bundle_file
Data type: Optional[String]
Default value: undef
compose_files
Data type: Optional[Array]
Default value: undef
prune
Data type: Optional[Boolean]
Default value: false
with_registry_auth
Data type: Optional[Boolean]
Default value: false
resolve_image
Data type: Optional[Pattern[/^always$|^changed$|^never$/]]
Default value: undef
docker::swarm
The docker::swarm class.
Parameters
The following parameters are available in the docker::swarm
defined type.
ensure
Data type: Optional[Pattern[/^present$|^absent$/]]
Default value: 'present'
init
Data type: Optional[Boolean]
Default value: false
join
Data type: Optional[Boolean]
Default value: false
advertise_addr
Data type: Optional[String]
Default value: undef
autolock
Data type: Optional[Boolean]
Default value: false
cert_expiry
Data type: Optional[String]
Default value: undef
default_addr_pool
Data type: Optional[Array]
Default value: undef
default_addr_pool_mask_length
Data type: Optional[String]
Default value: undef
dispatcher_heartbeat
Data type: Optional[String]
Default value: undef
external_ca
Data type: Optional[String]
Default value: undef
force_new_cluster
Data type: Optional[Boolean]
Default value: false
listen_addr
Data type: Optional[String]
Default value: undef
max_snapshots
Data type: Optional[String]
Default value: undef
snapshot_interval
Data type: Optional[String]
Default value: undef
token
Data type: Optional[String]
Default value: undef
manager_ip
Data type: Optional[String]
Default value: undef
docker::system_user
== Define: docker::system_user
Define to manage docker group users
=== Parameters [create_user] Boolean to cotrol whether the user should be created
Parameters
The following parameters are available in the docker::system_user
defined type.
create_user
Data type: Any
Default value: true
docker::windows_account
== Define: docker::windows_account
Define the Windows account that owns the docker services
Resource types
docker_compose
A type representing a Docker Compose file
Properties
The following properties are available in the docker_compose
type.
ensure
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
Parameters
The following parameters are available in the docker_compose
type.
scale
A hash of compose services and number of containers.
options
Additional options to be passed directly to docker-compose.
up_args
Arguments to be passed directly to docker-compose up.
compose_files
An array of Docker Compose Files paths.
name
namevar
The name of the project
docker_network
Type representing a Docker network
Properties
The following properties are available in the docker_network
type.
ensure
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
driver
The network driver used by the network
ipam_driver
The IPAM (IP Address Management) driver
id
The ID of the network provided by Docker
Parameters
The following parameters are available in the docker_network
type.
name
namevar
The name of the network
subnet
The subnet in CIDR format that represents a network segment
gateway
An ipv4 or ipv6 gateway for the master subnet
ip_range
The range of IP addresses used by the network
aux_address
Auxiliary ipv4 or ipv6 addresses used by the Network driver
options
Additional options for the network driver
additional_flags
Additional flags for the 'docker network create'
docker_stack
A type representing a Docker Stack
Properties
The following properties are available in the docker_stack
type.
ensure
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
Parameters
The following parameters are available in the docker_stack
type.
bundle_file
Path to a Distributed Application Bundle file.
compose_files
An array of Docker Compose Files paths.
up_args
Arguments to be passed directly to docker stack deploy.
name
namevar
The name of the stack
docker_volume
A type representing a Docker volume
Properties
The following properties are available in the docker_volume
type.
ensure
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
driver
The volume driver used by the volume
options
Additional options for the volume driver
mountpoint
The location that the volume is mounted to
Parameters
The following parameters are available in the docker_volume
type.
name
namevar
The name of the volume
Functions
docker::sanitised_name
Type: Puppet Language
== Function: docker::sanitised_name
Function to sanitise container name.
=== Parameters
[name] Name to sanitise
docker::sanitised_name(Any $name)
== Function: docker::sanitised_name
Function to sanitise container name.
=== Parameters
[name] Name to sanitise
Returns: Any
name
Data type: Any
docker_exec_flags
Type: Ruby 3.x API
Transforms a hash into a string of docker exec flags
docker_exec_flags()
Transforms a hash into a string of docker exec flags
Returns: Any
docker_plugin_enable_flags
Type: Ruby 3.x API
Transforms a hash into a string of docker plugin remove flags
docker_plugin_enable_flags()
Transforms a hash into a string of docker plugin remove flags
Returns: Any
docker_plugin_install_flags
Type: Ruby 3.x API
Transforms a hash into a string of docker plugin install flags
docker_plugin_install_flags()
Transforms a hash into a string of docker plugin install flags
Returns: Any
docker_plugin_remove_flags
Type: Ruby 3.x API
Transforms a hash into a string of docker plugin remove flags
docker_plugin_remove_flags()
Transforms a hash into a string of docker plugin remove flags
Returns: Any
docker_run_flags
Type: Ruby 3.x API
Transforms a hash into a string of docker flags
docker_run_flags()
Transforms a hash into a string of docker flags
Returns: Any
docker_secrets_flags
Type: Ruby 3.x API
Transforms a hash into a string of docker swarm init flags
docker_secrets_flags()
Transforms a hash into a string of docker swarm init flags
Returns: Any
docker_service_flags
Type: Ruby 3.x API
Transforms a hash into a string of docker swarm init flags
docker_service_flags()
Transforms a hash into a string of docker swarm init flags
Returns: Any
docker_stack_flags
Type: Ruby 3.x API
Transforms a hash into a string of docker stack flags
docker_stack_flags()
Transforms a hash into a string of docker stack flags
Returns: Any
docker_swarm_init_flags
Type: Ruby 3.x API
Transforms a hash into a string of docker swarm init flags
docker_swarm_init_flags()
Transforms a hash into a string of docker swarm init flags
Returns: Any
docker_swarm_join_flags
Type: Ruby 3.x API
Transforms a hash into a string of docker swarm init flags
docker_swarm_join_flags()
Transforms a hash into a string of docker swarm init flags
Returns: Any
Tasks
node_ls
List nodes in the swarm
Supports noop? false
Parameters
filter
Data type: Optional[String[1]]
Filter output based on conditions provided
quiet
Data type: Optional[Boolean]
Only display IDs
node_rm
Update a node
Supports noop? false
Parameters
force
Data type: Optional[Boolean]
Force remove a node from the swarm
node
Data type: String[1]
Hostname or ID of the node in the swarm
node_update
Update a node
Supports noop? false
Parameters
availability
Data type: Optional[Enum['active', 'pause', 'drain']]
Availability of the node
role
Data type: Optional[Enum['manager', 'worker']]
Role of the node
node
Data type: String[1]
Hostname or ID of the node in the swarm
service_scale
Scale one replicated service
Supports noop? false
Parameters
service
Data type: String[1]
Name or ID of the service
scale
Data type: Integer
Number of replicas
detatch
Data type: Optional[Boolean]
Exit immediately instead of waiting for the service to converge
swarm_init
Initializes a swarm
Supports noop? false
Parameters
advertise_addr
Data type: Optional[String[1]]
Advertised address
autolock
Data type: Optional[Boolean]
Enable manager autolocking
cert_expiry
Data type: Optional[String[1]]
Validity period for node certificates
dispatcher_heartbeat
Data type: Optional[String[1]]
Dispatcher heartbeat period
external_ca
Data type: Optional[String[1]]
Specifications of one or more certificate signing endpoints
force_new_cluster
Data type: Optional[Boolean]
Force create a new cluster from current state
listen_addr
Data type: Optional[String[1]]
Listen address
max_snapshots
Data type: Optional[Integer[1]]
Number of additional Raft snapshots to retain
snapshot_interval
Data type: Optional[Integer[1]]
Number of log entries between Raft snapshots
swarm_join
Join a swarm
Supports noop? false
Parameters
advertise_addr
Data type: Optional[String[1]]
Advertised address
listen_addr
Data type: Optional[String[1]]
Listen address
token
Data type: String[1]
Join token for the swarm
manager_ip
Data type: String[1]
IP Address of the swarm manager
swarm_leave
Leave a swarm
Supports noop? false
Parameters
force
Data type: Optional[Boolean]
Force this node to leave the swarm, ignoring warnings
swarm_token
Gets the swarm token from the master
Supports noop? false
Parameters
node_role
Data type: String[1]
The role of the node joining the swarm
swarm_update
Updates an existing service.
Supports noop? false
Parameters
service
Data type: String[1]
The service to update
image
Data type: String[1]
The new image to use for the service
What are tasks?
Modules can contain tasks that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.
Tasks in this module release
Change log
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v3.8.0 (2019-10-01)
Added
- pdksync - Add support on Debian10 #525 (lionce)
- Add new Docker Swarm Tasks (node ls, rm, update; service scale) #509 (khaefeli)
Fixed
- Fix multiple additional flags for docker_network #523 (lemrouch)
- :bug: Fix wrong service detach handling #520 (khaefeli)
- Fixing error: #516 (darshannnn)
- Fix aliased plugin names #514 (koshatul)
v3.7.0 (2019-07-18)
Added
v3.6.0 (2019-06-25)
Changed
Added
- (FM-8151) Add Windows Server 2019 support #493 (eimlav)
- Support for docker machine download and install #466 (acurus-puppetmaster)
- Add service_provider parameter to docker::run #376 (iamjamestl)
Fixed
- Tasks frozen string #499 (khaefeli)
- Fix #239 local_user permission denied #497 (thde)
- (MODULES-9193) Revert part of MODULES-9177 #490 (eimlav)
- (MODULES-9177) Fix version validation regex #489 (eimlav)
- Fix publish flag being erroneously added to docker service commands #471 (twistedduck)
- Fix container running check to work for windows hosts #470 (florindragos)
- Allow images tagged latest to update on each run #468 (electrofelix)
- Fix docker::image to not run images #465 (hugotanure)
3.5.0
Changes range for dependent modules
Use multiple networks in docker::run and docker::services
Fixes quotes with docker::services command
Publish multiple ports to docker::services
A full list of issues and PRs associated with this release can be found here
3.4.0
Introduces docker_stack type and provider
Fixes frozen string in docker swarm token task
Acceptance testing updates
Allow use of newer translate module
A full list of issues and PRs associated with this release can be found here
Version 3.3.0
Pins apt repo to 500 to ensure packages are updated
Fixes issue in docker fact failing when docker is not started
Acceptance testing updates
Allows more recent version of the reboot module
A full list of issues and PRs associated with this release can be found here
Version 3.2.0
Adds in support for Puppet 6
Containers will be restared due to script changes in PR #367
A full list of issues and PRs associated with this release can be found here
Version 3.1.0
Adding in the following faetures/functionality
- Docker Stack support on Windows.
Version 3.0.0
Various fixes for github issues
- 206
- 226
- 241
- 280
- 281
- 287
- 289
- 294
- 303
- 312
- 314
Adding in the following features/functionality
-Support for multiple compose files.
A full list of issues and PRs associated with this release can be found here
Version 2.0.0
Various fixes for github issues
- 193
- 197
- 198
- 203
- 207
- 208
- 209
- 211
- 212
- 213
- 215
- 216
- 217
- 218
- 223
- 224
- 225
- 228
- 229
- 230
- 232
- 234
- 237
- 243
- 245
- 255
- 256
- 259
Adding in the following features/functionality
- Ability to define swarm clusters in Hiera.
- Support docker compose file V2.3.
- Support refresh only flag.
- Support for Docker healthcheck and unhealthy container restart.
- Support for Docker on Windows:
- Add docker ee support for windows server 2016.
- Docker image on Windows.
- Docker run on Windows.
- Docker compose on Windows.
- Docker swarm on Windows.
- Add docker exec functionality for docker on windows.
- Add storage driver for Windows.
A full list of issues and PRs associated with this release can be found here
Version 1.1.0
Various fixes for Github issues
- 183
- 173
- 173
- 167
- 163
- 161
Adding in the following features/functionality
- IPv6 support
- Define type for docker plugins
A full list of issues and PRs associated with this release can be found here
Version 1.0.5
Various fixes for Github issues
- 98
- 104
- 115
- 122
- 124
Adding in the following features/functionality
- Removed all unsupported OS related code from module
- Removed EPEL dependency
- Added http support in compose proxy
- Added in rubocop support and i18 gem support
- Type and provider for docker volumes
- Update apt module to latest
- Added in support for a registry mirror
- Facts for docker version and docker info
- Fixes for $pass_hash undef
- Fixed typo in param.pp
- Replaced deprecated stblib functions with data types
Version 1.0.4
Correcting changelog
Version 1.0.3
Various fixes for Github issues
- 33
- 68
- 74
- 77
- 84
Adding in the following features/functionality:
- Add tasks to update existing service
- Backwards compatible TMPDIR
- Optional GPG check on repos
- Force pull on image tag 'latest'
- Add support for overlay2.override_kernel_check setting
- Add docker network fact
- Add pw hash for registry login idompodency
- Additional flags for creating a network
- Fixing incorrect repo url for redhat
Version 1.0.2
Various fixes for Github issues
- 9
- 11
- 15
- 21 Add tasks support for Docker Swarm
Version 1.0.1
Updated metadata and CHANGELOG
Version 1.0.0
Forked for garethr/docker v5.3.0 Added support for:
- Docker services within a swarm cluster
- Swarm mode
- Docker secrets
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 4.24.0 < 7.0.0)
- puppetlabs/apt (>= 4.4.1 < 8.0.0)
- puppetlabs/translate (>= 0.0.1 < 3.0.0)
- puppetlabs/powershell (>= 2.1.4 < 3.0.0)
- puppetlabs/reboot (>=2.0.0 < 3.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and 2. You must cause any modified files to carry prominent notices stating that You changed the files; and 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2013 Gareth Rushgrove Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.