Improve type documentation. (#62179)

pull/63146/head
Felix Fontein 6 years ago committed by GitHub
parent 41eafc2051
commit a59b9d4269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,6 +47,7 @@ options:
- List of Compose file names relative to I(project_src). Overrides C(docker-compose.yml) or C(docker-compose.yaml). - List of Compose file names relative to I(project_src). Overrides C(docker-compose.yml) or C(docker-compose.yaml).
- Files are loaded and merged in the order given. - Files are loaded and merged in the order given.
type: list type: list
elements: path
state: state:
description: description:
- Desired state of the project. - Desired state of the project.
@ -64,6 +65,7 @@ options:
on a subset of services. on a subset of services.
- If empty, which is the default, the operation will be performed on all services defined in the Compose file (or inline I(definition)). - If empty, which is the default, the operation will be performed on all services defined in the Compose file (or inline I(definition)).
type: list type: list
elements: str
scale: scale:
description: description:
- When I(state) is C(present) scale services. Provide a dictionary of key/value pairs where the key - When I(state) is C(present) scale services. Provide a dictionary of key/value pairs where the key

@ -50,10 +50,12 @@ options:
description: description:
- List of capabilities to add to the container. - List of capabilities to add to the container.
type: list type: list
elements: str
cap_drop: cap_drop:
description: description:
- List of capabilities to drop from the container. - List of capabilities to drop from the container.
type: list type: list
elements: str
version_added: "2.7" version_added: "2.7"
cleanup: cleanup:
description: description:
@ -119,10 +121,12 @@ options:
- "List of host device bindings to add to the container. Each binding is a mapping expressed - "List of host device bindings to add to the container. Each binding is a mapping expressed
in the format: <path_on_host>:<path_in_container>:<cgroup_permissions>" in the format: <path_on_host>:<path_in_container>:<cgroup_permissions>"
type: list type: list
elements: str
device_read_bps: device_read_bps:
description: description:
- "List of device path and read rate (bytes per second) from device." - "List of device path and read rate (bytes per second) from device."
type: list type: list
elements: dict
suboptions: suboptions:
path: path:
description: description:
@ -142,6 +146,7 @@ options:
description: description:
- "List of device and write rate (bytes per second) to device." - "List of device and write rate (bytes per second) to device."
type: list type: list
elements: dict
suboptions: suboptions:
path: path:
description: description:
@ -161,6 +166,7 @@ options:
description: description:
- "List of device and read rate (IO per second) from device." - "List of device and read rate (IO per second) from device."
type: list type: list
elements: dict
suboptions: suboptions:
path: path:
description: description:
@ -178,6 +184,7 @@ options:
description: description:
- "List of device and write rate (IO per second) to device." - "List of device and write rate (IO per second) to device."
type: list type: list
elements: dict
suboptions: suboptions:
path: path:
description: description:
@ -195,14 +202,17 @@ options:
description: description:
- list of DNS options - list of DNS options
type: list type: list
elements: str
dns_servers: dns_servers:
description: description:
- List of custom DNS servers. - List of custom DNS servers.
type: list type: list
elements: str
dns_search_domains: dns_search_domains:
description: description:
- List of custom DNS search domains. - List of custom DNS search domains.
type: list type: list
elements: str
domainname: domainname:
description: description:
- Container domainname. - Container domainname.
@ -223,6 +233,7 @@ options:
description: description:
- Command that overwrites the default ENTRYPOINT of the image. - Command that overwrites the default ENTRYPOINT of the image.
type: list type: list
elements: str
etc_hosts: etc_hosts:
description: description:
- Dict of host-to-IP mappings, where each host name is a key in the dictionary. - Dict of host-to-IP mappings, where each host name is a key in the dictionary.
@ -235,6 +246,7 @@ options:
If the port is already exposed using EXPOSE in a Dockerfile, it does not If the port is already exposed using EXPOSE in a Dockerfile, it does not
need to be exposed again. need to be exposed again.
type: list type: list
elements: str
aliases: aliases:
- exposed - exposed
- expose - expose
@ -249,6 +261,7 @@ options:
description: description:
- List of additional group names and/or IDs that the container process will run as. - List of additional group names and/or IDs that the container process will run as.
type: list type: list
elements: str
healthcheck: healthcheck:
description: description:
- 'Configure a check that is run to determine whether or not containers for this service are "healthy". - 'Configure a check that is run to determine whether or not containers for this service are "healthy".
@ -343,6 +356,7 @@ options:
- List of name aliases for linked containers in the format C(container_name:alias). - List of name aliases for linked containers in the format C(container_name:alias).
- Setting this will force container to be restarted. - Setting this will force container to be restarted.
type: list type: list
elements: str
log_driver: log_driver:
description: description:
- Specify the logging driver. Docker uses I(json-file) by default. - Specify the logging driver. Docker uses I(json-file) by default.
@ -389,6 +403,7 @@ options:
mounts: mounts:
version_added: "2.9" version_added: "2.9"
type: list type: list
elements: dict
description: description:
- 'Specification for mounts to be added to the container. More powerful alternative to I(volumes).' - 'Specification for mounts to be added to the container. More powerful alternative to I(volumes).'
suboptions: suboptions:
@ -490,6 +505,7 @@ options:
network if C(networks) is specified. You need to explicitly use C(purge_networks) to enforce network if C(networks) is specified. You need to explicitly use C(purge_networks) to enforce
the removal of the default network (and all other networks not explicitly mentioned in C(networks)). the removal of the default network (and all other networks not explicitly mentioned in C(networks)).
type: list type: list
elements: dict
suboptions: suboptions:
name: name:
description: description:
@ -508,11 +524,13 @@ options:
description: description:
- A list of containers to link to. - A list of containers to link to.
type: list type: list
elements: str
aliases: aliases:
description: description:
- List of aliases for this container in this network. These names - List of aliases for this container in this network. These names
can be used in the network to reach this container. can be used in the network to reach this container.
type: list type: list
elements: str
version_added: "2.2" version_added: "2.2"
networks_cli_compatible: networks_cli_compatible:
description: description:
@ -590,6 +608,7 @@ options:
Note that the first bridge network with a com.docker.network.bridge.host_binding_ipv4 Note that the first bridge network with a com.docker.network.bridge.host_binding_ipv4
value encountered in the list of C(networks) is the one that will be used. value encountered in the list of C(networks) is the one that will be used.
type: list type: list
elements: str
aliases: aliases:
- ports - ports
pull: pull:
@ -651,6 +670,7 @@ options:
description: description:
- List of security options in the form of C("label:user:User") - List of security options in the form of C("label:user:User")
type: list type: list
elements: str
state: state:
description: description:
- 'I(absent) - A container matching the specified name will be stopped and removed. Use force_kill to kill the container - 'I(absent) - A container matching the specified name will be stopped and removed. Use force_kill to kill the container
@ -703,6 +723,7 @@ options:
description: description:
- Mount a tmpfs directory - Mount a tmpfs directory
type: list type: list
elements: str
version_added: 2.4 version_added: 2.4
tty: tty:
description: description:
@ -713,6 +734,7 @@ options:
description: description:
- "List of ulimit options. A ulimit is specified as C(nofile:262144:262144)" - "List of ulimit options. A ulimit is specified as C(nofile:262144:262144)"
type: list type: list
elements: str
sysctls: sysctls:
description: description:
- Dictionary of key,value pairs. - Dictionary of key,value pairs.
@ -739,6 +761,7 @@ options:
- "Note that Ansible 2.7 and earlier only supported one mode, which had to be one of C(ro), C(rw), - "Note that Ansible 2.7 and earlier only supported one mode, which had to be one of C(ro), C(rw),
C(z), and C(Z)." C(z), and C(Z)."
type: list type: list
elements: str
volume_driver: volume_driver:
description: description:
- The container volume driver. - The container volume driver.
@ -747,6 +770,7 @@ options:
description: description:
- List of container names or Ids to get volumes from. - List of container names or Ids to get volumes from.
type: list type: list
elements: str
working_dir: working_dir:
description: description:
- Path to the working directory. - Path to the working directory.

@ -57,6 +57,7 @@ options:
description: description:
- List of image names to consider as cache source. - List of image names to consider as cache source.
type: list type: list
elements: str
dockerfile: dockerfile:
description: description:
- Use with state C(present) and source C(build) to provide an alternate name for the Dockerfile to use when building an image. - Use with state C(present) and source C(build) to provide an alternate name for the Dockerfile to use when building an image.

@ -38,6 +38,7 @@ options:
where C(tag) is optional. If a tag is not provided, C(latest) will be used. Instead of image names, also where C(tag) is optional. If a tag is not provided, C(latest) will be used. Instead of image names, also
image IDs can be used. image IDs can be used.
type: list type: list
elements: str
required: yes required: yes
extends_documentation_fragment: extends_documentation_fragment:

@ -32,6 +32,7 @@ options:
description: description:
- List of container names or container IDs to connect to a network. - List of container names or container IDs to connect to a network.
type: list type: list
elements: str
aliases: aliases:
- containers - containers
@ -115,6 +116,7 @@ options:
L(Docker docs,https://docs.docker.com/compose/compose-file/compose-file-v2/#ipam) for valid options and values. L(Docker docs,https://docs.docker.com/compose/compose-file/compose-file-v2/#ipam) for valid options and values.
Note that I(iprange) is spelled differently here (we use the notation from the Docker SDK for Python). Note that I(iprange) is spelled differently here (we use the notation from the Docker SDK for Python).
type: list type: list
elements: dict
suboptions: suboptions:
subnet: subnet:
description: description:

@ -59,6 +59,7 @@ options:
- If I(labels_state) is C(replace) and I(labels) is not provided or empty then all labels assigned to - If I(labels_state) is C(replace) and I(labels) is not provided or empty then all labels assigned to
node are removed and I(labels_to_remove) is ignored. node are removed and I(labels_to_remove) is ignored.
type: list type: list
elements: str
availability: availability:
description: Node availability to assign. If not provided then node availability remains unchanged. description: Node availability to assign. If not provided then node availability remains unchanged.
choices: choices:

@ -33,6 +33,7 @@ options:
- When identifying the node use either the hostname of the node (as registered in Swarm) or node ID. - When identifying the node use either the hostname of the node (as registered in Swarm) or node ID.
- If I(self) is C(true) then this parameter is ignored. - If I(self) is C(true) then this parameter is ignored.
type: list type: list
elements: str
self: self:
description: description:
- If C(true), queries the node (i.e. the docker daemon) the module communicates with. - If C(true), queries the node (i.e. the docker daemon) the module communicates with.

@ -41,6 +41,7 @@ options:
referring to the path of the compose file on the target host referring to the path of the compose file on the target host
or the YAML contents of a compose file nested as dictionary. or the YAML contents of a compose file nested as dictionary.
type: list type: list
# elements: raw
default: [] default: []
prune: prune:
description: description:
@ -210,7 +211,7 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec={ argument_spec={
'name': dict(type='str', required=True), 'name': dict(type='str', required=True),
'compose': dict(type='list', default=[]), 'compose': dict(type='list', elements='raw', default=[]),
'prune': dict(type='bool', default=False), 'prune': dict(type='bool', default=False),
'with_registry_auth': dict(type='bool', default=False), 'with_registry_auth': dict(type='bool', default=False),
'resolve_image': dict(type='str', choices=['always', 'changed', 'never']), 'resolve_image': dict(type='str', choices=['always', 'changed', 'never']),

@ -39,6 +39,7 @@ options:
for idempotency checking. for idempotency checking.
- Requires API version >= 1.39. - Requires API version >= 1.39.
type: list type: list
elements: str
version_added: "2.8" version_added: "2.8"
subnet_size: subnet_size:
description: description:
@ -98,6 +99,7 @@ options:
- Remote address of one or more manager nodes of an existing Swarm to connect to. - Remote address of one or more manager nodes of an existing Swarm to connect to.
- Used with I(state=join). - Used with I(state=join).
type: list type: list
elements: str
task_history_retention_limit: task_history_retention_limit:
description: description:
- Maximum number of tasks history stored. - Maximum number of tasks history stored.

@ -26,6 +26,7 @@ options:
- List arguments to be passed to the container. - List arguments to be passed to the container.
- Corresponds to the C(ARG) parameter of C(docker service create). - Corresponds to the C(ARG) parameter of C(docker service create).
type: list type: list
elements: str
command: command:
description: description:
- Command to execute when the container starts. - Command to execute when the container starts.
@ -39,6 +40,7 @@ options:
- Corresponds to the C(--config) option of C(docker service create). - Corresponds to the C(--config) option of C(docker service create).
- Requires API version >= 1.30. - Requires API version >= 1.30.
type: list type: list
elements: dict
suboptions: suboptions:
config_id: config_id:
description: description:
@ -72,6 +74,7 @@ options:
- Corresponds to the C(--constraint) option of C(docker service create). - Corresponds to the C(--constraint) option of C(docker service create).
- Deprecated in 2.8, will be removed in 2.12. Use parameter C(placement.constraints) instead. - Deprecated in 2.8, will be removed in 2.12. Use parameter C(placement.constraints) instead.
type: list type: list
elements: str
container_labels: container_labels:
description: description:
- Dictionary of key value pairs. - Dictionary of key value pairs.
@ -83,18 +86,21 @@ options:
- Corresponds to the C(--dns) option of C(docker service create). - Corresponds to the C(--dns) option of C(docker service create).
- Requires API version >= 1.25. - Requires API version >= 1.25.
type: list type: list
elements: str
dns_search: dns_search:
description: description:
- List of custom DNS search domains. - List of custom DNS search domains.
- Corresponds to the C(--dns-search) option of C(docker service create). - Corresponds to the C(--dns-search) option of C(docker service create).
- Requires API version >= 1.25. - Requires API version >= 1.25.
type: list type: list
elements: str
dns_options: dns_options:
description: description:
- List of custom DNS options. - List of custom DNS options.
- Corresponds to the C(--dns-option) option of C(docker service create). - Corresponds to the C(--dns-option) option of C(docker service create).
- Requires API version >= 1.25. - Requires API version >= 1.25.
type: list type: list
elements: str
endpoint_mode: endpoint_mode:
description: description:
- Service endpoint mode. - Service endpoint mode.
@ -120,6 +126,7 @@ options:
variable that shows up more than once. variable that shows up more than once.
- If variable also present in I(env), then I(env) value will override. - If variable also present in I(env), then I(env) value will override.
type: list type: list
elements: path
version_added: "2.8" version_added: "2.8"
force_update: force_update:
description: description:
@ -134,6 +141,7 @@ options:
- Corresponds to the C(--group) option of C(docker service update). - Corresponds to the C(--group) option of C(docker service update).
- Requires API version >= 1.25. - Requires API version >= 1.25.
type: list type: list
elements: str
version_added: "2.8" version_added: "2.8"
healthcheck: healthcheck:
description: description:
@ -271,6 +279,7 @@ options:
- List of dictionaries describing the service mounts. - List of dictionaries describing the service mounts.
- Corresponds to the C(--mount) option of C(docker service create). - Corresponds to the C(--mount) option of C(docker service create).
type: list type: list
elements: dict
suboptions: suboptions:
source: source:
description: description:
@ -365,6 +374,7 @@ options:
If changes are made the service will then be removed and recreated. If changes are made the service will then be removed and recreated.
- Corresponds to the C(--network) option of C(docker service create). - Corresponds to the C(--network) option of C(docker service create).
type: list type: list
elements: raw
placement: placement:
description: description:
- Configures service placement preferences and constraints. - Configures service placement preferences and constraints.
@ -374,12 +384,14 @@ options:
- List of the service constraints. - List of the service constraints.
- Corresponds to the C(--constraint) option of C(docker service create). - Corresponds to the C(--constraint) option of C(docker service create).
type: list type: list
elements: str
preferences: preferences:
description: description:
- List of the placement preferences as key value pairs. - List of the placement preferences as key value pairs.
- Corresponds to the C(--placement-pref) option of C(docker service create). - Corresponds to the C(--placement-pref) option of C(docker service create).
- Requires API version >= 1.27. - Requires API version >= 1.27.
type: list type: list
elements: dict
type: dict type: dict
version_added: "2.8" version_added: "2.8"
publish: publish:
@ -388,6 +400,7 @@ options:
- Corresponds to the C(--publish) option of C(docker service create). - Corresponds to the C(--publish) option of C(docker service create).
- Requires API version >= 1.25. - Requires API version >= 1.25.
type: list type: list
elements: dict
suboptions: suboptions:
published_port: published_port:
description: description:
@ -593,6 +606,7 @@ options:
- Corresponds to the C(--secret) option of C(docker service create). - Corresponds to the C(--secret) option of C(docker service create).
- Requires API version >= 1.25. - Requires API version >= 1.25.
type: list type: list
elements: dict
suboptions: suboptions:
secret_id: secret_id:
description: description:
@ -2673,14 +2687,14 @@ def main():
mode=dict(type='str', choices=['ingress', 'host']), mode=dict(type='str', choices=['ingress', 'host']),
)), )),
placement=dict(type='dict', options=dict( placement=dict(type='dict', options=dict(
constraints=dict(type='list'), constraints=dict(type='list', elements='str'),
preferences=dict(type='list'), preferences=dict(type='list', elements='dict'),
)), )),
constraints=dict(type='list', removed_in_version='2.12'), constraints=dict(type='list', elements='str', removed_in_version='2.12'),
tty=dict(type='bool'), tty=dict(type='bool'),
dns=dict(type='list'), dns=dict(type='list', elements='str'),
dns_search=dict(type='list'), dns_search=dict(type='list', elements='str'),
dns_options=dict(type='list'), dns_options=dict(type='list', elements='str'),
healthcheck=dict(type='dict', options=dict( healthcheck=dict(type='dict', options=dict(
test=dict(type='raw'), test=dict(type='raw'),
interval=dict(type='str'), interval=dict(type='str'),

Loading…
Cancel
Save