Skip to content

Latest commit

 

History

History
3976 lines (1690 loc) · 54.2 KB

REFERENCE.md

File metadata and controls

3976 lines (1690 loc) · 54.2 KB

Reference

Table of Contents

Classes

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 t
  • docker::plugin:
  • docker::registry: == Class: docker Module to configure private docker registries from which to pull Docker images If the registry does not require authenticat
  • docker::run: == Define: docker:run A define which manages a running docker container. == Parameters [restart] Sets a restart policy on the docker run
  • docker::secrets: == Define: docker::secrets
  • docker::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 shou
  • docker::windows_account: == Define: docker::windows_account Define the Windows account that owns the docker services

Resource types

Functions

Tasks

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