docker modules: add missing option types (#52422)

* Add missing option types for docker modules.

* Reorder argument_spec.

* First part of option reordering/reformatting.

* Second part of option reordering/reformatting.

* Forgot two required: false.

* Normalize booleans.

* Added missing period.
This commit is contained in:
Felix Fontein 2019-02-18 21:40:52 +01:00 committed by ansibot
parent 0e9ff44df1
commit 8388c89a29
18 changed files with 647 additions and 561 deletions

View file

@ -25,14 +25,13 @@ options:
- The hostname or ID of node as registered in Swarm.
- If more than one node is registered using the same hostname the ID must be used,
otherwise module will fail.
required: true
type: str
required: yes
labels:
description:
- User-defined key/value metadata that will be assigned as node attribute.
- The actual state of labels assigned to the node when module completes its work depends on
I(labels_state) and I(labels_to_remove) parameters values. See description below.
required: false
type: dict
labels_state:
description:
@ -43,12 +42,11 @@ options:
If I(labels) is empty then no changes will be made.
- Set to C(replace) to replace all assigned labels with provided ones. If I(labels) is empty then
all labels assigned to the node will be removed.
type: str
default: 'merge'
choices:
- merge
- replace
default: 'merge'
required: false
type: str
labels_to_remove:
description:
- List of labels that will be removed from the node configuration. The list has to contain only label
@ -58,7 +56,6 @@ options:
assigned to the node.
- 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.
required: false
type: list
availability:
description: Node availability to assign. If not provided then node availability remains unchanged.
@ -66,14 +63,12 @@ options:
- active
- pause
- drain
required: false
type: str
role:
description: Node role to assign. If not provided then node role remains unchanged.
choices:
- manager
- worker
required: false
type: str
extends_documentation_fragment:
- docker
@ -262,7 +257,7 @@ def main():
argument_spec = dict(
hostname=dict(type='str', required=True),
labels=dict(type='dict'),
labels_state=dict(type='str', choices=['merge', 'replace'], default='merge'),
labels_state=dict(type='str', default='merge', choices=['merge', 'replace']),
labels_to_remove=dict(type='list', elements='str'),
availability=dict(type='str', choices=['active', 'pause', 'drain']),
role=dict(type='str', choices=['worker', 'manager']),