Updating docker_container_module proposal

pull/14726/head
chouseknecht 9 years ago
parent 70e7be0346
commit b2dd22e9f2

@ -4,7 +4,7 @@
The purpose of docker_container is to manage the lifecycle of a container. The module will provide a mechanism for The purpose of docker_container is to manage the lifecycle of a container. The module will provide a mechanism for
moving the container between absent, present, stopped and started states. It will focus purely on managing container moving the container between absent, present, stopped and started states. It will focus purely on managing container
state. The intention of the narrow focus is to make understanding and using the module clear and to keep maintenance state. The intention of the narrow focus is to make understanding and using the module clear and keep maintenance
and testing as easy as possible. and testing as easy as possible.
Docker_container will manage a container using docker-py to communicate with either a local or remote API. It will Docker_container will manage a container using docker-py to communicate with either a local or remote API. It will
@ -19,7 +19,7 @@ leading the way. If this project is successful, it will naturally deprecate the
Docker_container will accept the parameters listed below. An attempt has been made to represent all the options available to Docker_container will accept the parameters listed below. An attempt has been made to represent all the options available to
docker's create, kill, pause, run, rm, start, stop and update commands. docker's create, kill, pause, run, rm, start, stop and update commands.
Parameters related to connecting to the API are not listed here. Parameters for connecting to the API are not listed here. They are included in the common utility module mentioned above.
``` ```
blkio_weight: blkio_weight:
@ -49,7 +49,7 @@ cgroup_parent:
command: command:
description: description:
- Command executed in the container when it starts. - Command or list of commands to execute in the container when it starts.
default: null default: null
cpu_period: cpu_period:
@ -113,12 +113,6 @@ dns_servers:
- List of custom DNS servers. - List of custom DNS servers.
default: null default: null
dns_opts:
description:
- List of custom DNS options. Each option is written as an options line
into the container's /etc/resolv.conf.
default: null
dns_search_domains: dns_search_domains:
description: description:
- List of custom DNS search domains. - List of custom DNS search domains.
@ -183,9 +177,11 @@ ipv6_address:
- Container IPv6 address. - Container IPv6 address.
default: null default: null
ipc_namespace: ipc_mode:
description: description:
- Container IPC namespace. - Set the IPC mode for the container. Can be one of
'container:<name|id>' to reuse another container's IPC namespace
or 'host' to use the host's IPC namespace within the container.
default: null default: null
keep_volumes: keep_volumes:
@ -227,10 +223,10 @@ log_driver:
- splunk - splunk
defult: json-file defult: json-file
log_opt: log_options:
description: description:
- Additional options to pass to the logging driver selected above. See Docker `log-driver - Dictionary of options specific to the chosen log_driver. See https://docs.docker.com/engine/admin/logging/overview/
<https://docs.docker.com/reference/logging/overview/>` documentation for more information. for details.
required: false required: false
default: null default: null
@ -268,13 +264,14 @@ name:
- When identifying an existing container name may be a name or a long or short container ID. - When identifying an existing container name may be a name or a long or short container ID.
required: true required: true
net: network_mode:
description: description:
- Connect the container to a network. - Connect the container to a network.
choices: choices:
- bridge - bridge
- container:<name|id> - container:<name|id>
- host - host
- none
default: null default: null
net_alias: net_alias:
@ -287,7 +284,7 @@ paused:
- Use with the started state to pause running processes inside the container. - Use with the started state to pause running processes inside the container.
default: false default: false
pid: pid_mode:
description: description:
- Set the PID namespace mode for the container. Currenly only supports 'host'. - Set the PID namespace mode for the container. Currenly only supports 'host'.
default: null default: null
@ -325,15 +322,13 @@ restart_policy:
description: description:
- Container restart policy. - Container restart policy.
choices: choices:
- no
- on-failure - on-failure
- always - always
- unless-stopped default: on-failure
default: no
restart_policy_retry: restart_retries:
description: description:
- When C(restart_policy) is on-failure sets the max number of retries. - Use with restart policy to control maximum number of restart attempts.
default: 0 default: 0
shm_size: shm_size:
@ -419,13 +414,13 @@ volumes:
- List of volumes to mount within the container. - List of volumes to mount within the container.
- 'Use docker CLI-style syntax: C(/host:/container[:mode])' - 'Use docker CLI-style syntax: C(/host:/container[:mode])'
- You can specify a read mode for the mount with either C(ro) or C(rw). - You can specify a read mode for the mount with either C(ro) or C(rw).
Starting at version 2.1, SELinux hosts can additionally use C(z) or C(Z) - SELinux hosts can additionally use C(z) or C(Z) to use a shared or
mount options to use a shared or private label for the volume. private label for the volume.
default: null default: null
volumes_from: volumes_from:
description: description:
- List of container names to mount volumes from. - List of container names or Ids to get volumes from.
default: null default: null
``` ```
@ -512,14 +507,10 @@ The JSON object returned by the module will include a *results* object providing
``` ```
{ {
changed: True, changed: True,
failed: False,
rc: 0
results: { results: {
< the results of `docker inspect` > < the results of `docker inspect` >
} }
} }
``` ```
## Contributors
[chouseknecht](http://twitter.com/chouseknecht)
*Last Updated:* 2016-02-24

Loading…
Cancel
Save