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.
This commit is contained in:
Felix Fontein 2019-12-09 13:39:02 +01:00 committed by GitHub
parent 9f87978eb3
commit e9cec0262d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 11 additions and 18 deletions

View file

@ -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``."

View file

@ -804,7 +804,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'),

View file

@ -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

View file

@ -29,7 +29,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
@ -39,16 +38,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:
- Does nothing, do not use.
- Will be removed in Ansible 2.14.

View file

@ -218,7 +218,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)
},

View file

@ -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

View file

@ -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

View file

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

View file

@ -787,10 +787,6 @@ lib/ansible/modules/cloud/dimensiondata/dimensiondata_vlan.py validate-modules:d
lib/ansible/modules/cloud/dimensiondata/dimensiondata_vlan.py validate-modules:doc-required-mismatch
lib/ansible/modules/cloud/dimensiondata/dimensiondata_vlan.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/docker/docker_container.py use-argspec-type-path # uses colon-separated paths, can't use type=path
lib/ansible/modules/cloud/docker/docker_image_info.py validate-modules:doc-required-mismatch
lib/ansible/modules/cloud/docker/docker_login.py validate-modules:doc-required-mismatch
lib/ansible/modules/cloud/docker/docker_swarm.py validate-modules:doc-required-mismatch
lib/ansible/modules/cloud/docker/docker_swarm_service.py validate-modules:doc-required-mismatch
lib/ansible/modules/cloud/google/_gcdns_record.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/google/_gcdns_zone.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/google/_gce.py pylint:blacklisted-name