docker_* modules: fix various errors in argument specs (#65632)

* Fix various errors in docker module argument specs.

* Adjust PR #.

* Fix option name.

* Fix username/password requirements for docker_login.

(cherry picked from commit e9cec0262d)
pull/66383/head
Felix Fontein 5 years ago committed by Matt Clay
parent 69070402f0
commit 3ff86a5cad

@ -0,0 +1,3 @@
bugfixes:
- "docker_image - fix validation of build options."
- "docker_login - fix error handling when ``username`` or ``password`` is not specified when ``state`` is ``present``."

@ -808,7 +808,7 @@ class ImageManager(DockerBaseClass):
def main():
argument_spec = dict(
source=dict(type='str', choices=['build', 'load', 'pull', 'local']),
build=dict(type='dict', suboptions=dict(
build=dict(type='dict', options=dict(
cache_from=dict(type='list', elements='str'),
container_limits=dict(type='dict', options=dict(
memory=dict(type='int'),

@ -37,9 +37,9 @@ options:
- An image name or a list of image names. Name format will be C(name[:tag]) or C(repository/name[:tag]),
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.
- If no name is provided, a list of all images will be returned.
type: list
elements: str
required: yes
extends_documentation_fragment:
- docker

@ -28,7 +28,6 @@ description:
- Running in check mode will perform the authentication without updating the config file.
options:
registry_url:
required: False
description:
- The registry URL.
type: str
@ -38,16 +37,15 @@ options:
- url
username:
description:
- The username for the registry account
- The username for the registry account.
- Required when I(state) is C(present).
type: str
required: yes
password:
description:
- The plaintext password for the registry account
- The plaintext password for the registry account.
- Required when I(state) is C(present).
type: str
required: yes
email:
required: False
description:
- "The email address for the registry account."
type: str

@ -215,7 +215,7 @@ def main():
'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(tpye='str', default='present', choices=['present', 'absent']),
'state': dict(type='str', default='present', choices=['present', 'absent']),
'absent_retries': dict(type='int', default=0),
'absent_retries_interval': dict(type='int', default=1)
},

@ -76,7 +76,6 @@ options:
Note that removing requires Docker SDK for Python >= 2.4.0.
- Set to C(inspect) to display swarm informations.
type: str
required: yes
default: present
choices:
- present

@ -55,7 +55,6 @@ options:
description:
- Name of the file containing the config. Defaults to the I(config_name) if not specified.
type: str
required: yes
uid:
description:
- UID of the config file's owner.
@ -194,7 +193,6 @@ options:
- Service image path and tag.
- Corresponds to the C(IMAGE) parameter of C(docker service create).
type: str
required: yes
labels:
description:
- Dictionary of key value pairs.
@ -640,7 +638,6 @@ options:
- C(present) - Asserts the existence of a service matching the name and provided configuration parameters.
Unspecified configuration parameters will be set to docker defaults.
type: str
required: yes
default: present
choices:
- present

@ -276,7 +276,7 @@
name: "{{ iname }}"
build:
path: "{{ role_path }}/files"
dockefile: "EtcHostsDockerfile"
dockerfile: "EtcHostsDockerfile"
pull: no
etc_hosts:
some-custom-host: "127.0.0.1"

Loading…
Cancel
Save