mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
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:
parent
0e9ff44df1
commit
8388c89a29
18 changed files with 647 additions and 561 deletions
|
@ -18,63 +18,68 @@ module: docker_stack
|
|||
author: "Dario Zanzico (@dariko)"
|
||||
short_description: docker stack module
|
||||
description:
|
||||
- Manage docker stacks using the 'docker stack' command
|
||||
on the target node
|
||||
(see examples)
|
||||
- Manage docker stacks using the 'docker stack' command
|
||||
on the target node (see examples).
|
||||
version_added: "2.8"
|
||||
options:
|
||||
name:
|
||||
required: true
|
||||
description:
|
||||
- Stack name
|
||||
state:
|
||||
description:
|
||||
- Service state.
|
||||
default: "present"
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
compose:
|
||||
default: []
|
||||
description:
|
||||
- List of compose definitions. Any element may be a string
|
||||
referring to the path of the compose file on the target host
|
||||
or the YAML contents of a compose file nested as dictionary.
|
||||
prune:
|
||||
default: false
|
||||
description:
|
||||
- If true will add the C(--prune) option to the C(docker stack deploy) command.
|
||||
This will have docker remove the services not present in the
|
||||
current stack definition.
|
||||
type: bool
|
||||
with_registry_auth:
|
||||
default: false
|
||||
description:
|
||||
- If true will add the C(--with-registry-auth) option to the C(docker stack deploy) command.
|
||||
This will have docker send registry authentication details to Swarm agents.
|
||||
type: bool
|
||||
resolve_image:
|
||||
choices: ["always", "changed", "never"]
|
||||
description:
|
||||
- If set will add the C(--resolve-image) option to the C(docker stack deploy) command.
|
||||
This will have docker query the registry to resolve image digest and
|
||||
supported platforms. If not set, docker use "always" by default.
|
||||
absent_retries:
|
||||
default: 0
|
||||
description:
|
||||
- If C(>0) and C(state==absent) the module will retry up to
|
||||
C(absent_retries) times to delete the stack until all the
|
||||
resources have been effectively deleted.
|
||||
If the last try still reports the stack as not completely
|
||||
removed the module will fail.
|
||||
absent_retries_interval:
|
||||
default: 1
|
||||
description:
|
||||
- Interval in seconds between C(absent_retries)
|
||||
name:
|
||||
description:
|
||||
- Stack name
|
||||
type: str
|
||||
required: yes
|
||||
state:
|
||||
description:
|
||||
- Service state.
|
||||
type: str
|
||||
default: "present"
|
||||
choices:
|
||||
- present
|
||||
- absent
|
||||
compose:
|
||||
description:
|
||||
- List of compose definitions. Any element may be a string
|
||||
referring to the path of the compose file on the target host
|
||||
or the YAML contents of a compose file nested as dictionary.
|
||||
type: list
|
||||
default: []
|
||||
prune:
|
||||
description:
|
||||
- If true will add the C(--prune) option to the C(docker stack deploy) command.
|
||||
This will have docker remove the services not present in the
|
||||
current stack definition.
|
||||
type: bool
|
||||
default: no
|
||||
with_registry_auth:
|
||||
description:
|
||||
- If true will add the C(--with-registry-auth) option to the C(docker stack deploy) command.
|
||||
This will have docker send registry authentication details to Swarm agents.
|
||||
type: bool
|
||||
default: no
|
||||
resolve_image:
|
||||
description:
|
||||
- If set will add the C(--resolve-image) option to the C(docker stack deploy) command.
|
||||
This will have docker query the registry to resolve image digest and
|
||||
supported platforms. If not set, docker use "always" by default.
|
||||
type: str
|
||||
choices: ["always", "changed", "never"]
|
||||
absent_retries:
|
||||
description:
|
||||
- If C(>0) and C(state==absent) the module will retry up to
|
||||
C(absent_retries) times to delete the stack until all the
|
||||
resources have been effectively deleted.
|
||||
If the last try still reports the stack as not completely
|
||||
removed the module will fail.
|
||||
type: int
|
||||
default: 0
|
||||
absent_retries_interval:
|
||||
description:
|
||||
- Interval in seconds between C(absent_retries)
|
||||
type: int
|
||||
default: 1
|
||||
|
||||
requirements:
|
||||
- jsondiff
|
||||
- pyyaml
|
||||
- jsondiff
|
||||
- pyyaml
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
@ -204,12 +209,12 @@ def docker_stack_rm(module, stack_name, retries, interval):
|
|||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec={
|
||||
'name': dict(required=True, type='str'),
|
||||
'compose': dict(required=False, type='list', default=[]),
|
||||
'prune': dict(default=False, type='bool'),
|
||||
'with_registry_auth': dict(default=False, type='bool'),
|
||||
'name': dict(type='str', required=True),
|
||||
'compose': dict(type='list', default=[]),
|
||||
'prune': dict(type='bool', default=False),
|
||||
'with_registry_auth': dict(type='bool', default=False),
|
||||
'resolve_image': dict(type='str', choices=['always', 'changed', 'never']),
|
||||
'state': dict(default='present', choices=['present', 'absent']),
|
||||
'state': dict(tpye='str', default='present', choices=['present', 'absent']),
|
||||
'absent_retries': dict(type='int', default=0),
|
||||
'absent_retries_interval': dict(type='int', default=1)
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue