Get information about docker namespaces/repositories/images.
Version added: 0.4.0
- Get information about docker namespaces/repositories/images.
- https://docs.docker.com/docker-hub/api/latest/#tag/images
- https://hub.docker.com/support/doc/how-do-i-authenticate-with-the-v2-api
The below requirements are needed on the host that executes this module.
- requests
- name: get jwt token from docker hub
community.missing_collection.docker_hub_token:
username: 'testUser'
password: 'aDL0xxxxxxxxxxoQt6'
register: '__'
- name: get all namespaces from docker hub
community.missing_collection.docker_hub_info:
token: '{{ __.token }}'
list_namespaces: true
register: '__ns'
- name: get all repositories for given username
community.missing_collection.docker_hub_info:
token: '{{ __.token }}'
list_repositories: true
username: 'testUser'
- name: get repository summary
community.missing_collection.docker_hub_info:
token: '{{ __.token }}'
get_repository_summary: true
namespace: 'testUser'
repository: 'test'
- name: get repository images (required Pro license)
community.missing_collection.docker_hub_info:
token: '{{ __.token }}'
get_repository_images: true
namespace: 'testUser'
repository: 'test'
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
result
dictionary
|
when success. |
result of docker hub api.
Sample:
{'namespaces': ['testUser']}
|
- Davinder Pal (@116davinder) <dpsangwal@gmail.com>