mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
docker: rename docker_*_facts -> docker_*_info (#54124)
* Rename docker_*_facts -> docker_*_info. * Add changelog. * Update scenario guide.
This commit is contained in:
parent
9c77509cbc
commit
8d62794f91
40 changed files with 114 additions and 106 deletions
1
lib/ansible/modules/cloud/docker/_docker_image_facts.py
Symbolic link
1
lib/ansible/modules/cloud/docker/_docker_image_facts.py
Symbolic link
|
@ -0,0 +1 @@
|
|||
docker_image_info.py
|
|
@ -14,7 +14,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: docker_container_facts
|
||||
module: docker_container_info
|
||||
|
||||
short_description: Retrieves facts about docker container
|
||||
|
||||
|
@ -46,7 +46,7 @@ requirements:
|
|||
|
||||
EXAMPLES = '''
|
||||
- name: Get infos on container
|
||||
docker_container_facts:
|
||||
docker_container_info:
|
||||
name: mydata
|
||||
register: result
|
||||
|
|
@ -14,7 +14,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: docker_host_facts
|
||||
module: docker_host_info
|
||||
|
||||
short_description: Retrieves facts about docker host and lists of objects of the services.
|
||||
|
||||
|
@ -87,7 +87,7 @@ options:
|
|||
- When set to C(yes) and I(networks), I(volumes), I(images), I(containers) or I(disk_usage) is set to C(yes)
|
||||
then output will contain verbose information about objects matching the full output of API method.
|
||||
For details see the documentation of your version of Docker API at L(https://docs.docker.com/engine/api/).
|
||||
- The verbose output in this module contains only subset of information returned by I(_facts) module
|
||||
- The verbose output in this module contains only subset of information returned by I(_info) module
|
||||
for each type of the objects.
|
||||
type: bool
|
||||
default: no
|
||||
|
@ -105,29 +105,29 @@ requirements:
|
|||
|
||||
EXAMPLES = '''
|
||||
- name: Get info on docker host
|
||||
docker_host_facts:
|
||||
docker_host_info:
|
||||
register: result
|
||||
|
||||
- name: Get info on docker host and list images
|
||||
docker_host_facts:
|
||||
docker_host_info:
|
||||
images: yes
|
||||
register: result
|
||||
|
||||
- name: Get info on docker host and list images matching the filter
|
||||
docker_host_facts:
|
||||
docker_host_info:
|
||||
images: yes
|
||||
images_filters:
|
||||
label: "mylabel"
|
||||
register: result
|
||||
|
||||
- name: Get info on docker host and verbose list images
|
||||
docker_host_facts:
|
||||
docker_host_info:
|
||||
images: yes
|
||||
verbose_output: yes
|
||||
register: result
|
||||
|
||||
- name: Get info on docker host and used disk space
|
||||
docker_host_facts:
|
||||
docker_host_info:
|
||||
disk_usage: yes
|
||||
register: result
|
||||
|
|
@ -14,7 +14,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: docker_image_facts
|
||||
module: docker_image_info
|
||||
|
||||
short_description: Inspect docker images
|
||||
|
||||
|
@ -23,6 +23,9 @@ version_added: "2.1.0"
|
|||
description:
|
||||
- Provide one or more image names, and the module will inspect each, returning an array of inspection results.
|
||||
|
||||
notes:
|
||||
- This module was called C(docker_image_facts) before Ansible 2.8. The usage did not change.
|
||||
|
||||
options:
|
||||
name:
|
||||
description:
|
||||
|
@ -48,11 +51,11 @@ author:
|
|||
EXAMPLES = '''
|
||||
|
||||
- name: Inspect a single image
|
||||
docker_image_facts:
|
||||
docker_image_info:
|
||||
name: pacur/centos-7
|
||||
|
||||
- name: Inspect multiple images
|
||||
docker_image_facts:
|
||||
docker_image_info:
|
||||
name:
|
||||
- pacur/centos-7
|
||||
- sinatra
|
||||
|
@ -228,6 +231,8 @@ def main():
|
|||
supports_check_mode=True,
|
||||
min_docker_api_version='1.20',
|
||||
)
|
||||
if client.module._name == 'docker_image_facts':
|
||||
client.module.deprecate("The 'docker_image_facts' module has been renamed to 'docker_image_info'", version='2.12')
|
||||
|
||||
results = dict(
|
||||
changed=False,
|
|
@ -14,7 +14,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: docker_network_facts
|
||||
module: docker_network_info
|
||||
|
||||
short_description: Retrieves facts about docker network
|
||||
|
||||
|
@ -46,7 +46,7 @@ requirements:
|
|||
|
||||
EXAMPLES = '''
|
||||
- name: Get infos on network
|
||||
docker_network_facts:
|
||||
docker_network_info:
|
||||
name: mydata
|
||||
register: result
|
||||
|
|
@ -13,7 +13,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: docker_node_facts
|
||||
module: docker_node_info
|
||||
|
||||
short_description: Retrieves facts about docker swarm node from Swarm Manager
|
||||
|
||||
|
@ -54,23 +54,23 @@ requirements:
|
|||
|
||||
EXAMPLES = '''
|
||||
- name: Get info on all nodes
|
||||
docker_node_facts:
|
||||
docker_node_info:
|
||||
register: result
|
||||
|
||||
- name: Get info on node
|
||||
docker_node_facts:
|
||||
docker_node_info:
|
||||
name: mynode
|
||||
register: result
|
||||
|
||||
- name: Get info on list of nodes
|
||||
docker_node_facts:
|
||||
docker_node_info:
|
||||
name:
|
||||
- mynode1
|
||||
- mynode2
|
||||
register: result
|
||||
|
||||
- name: Get info on host if it is Swarm Manager
|
||||
docker_node_facts:
|
||||
docker_node_info:
|
||||
self: true
|
||||
register: result
|
||||
'''
|
|
@ -412,7 +412,7 @@ class SwarmManager(DockerBaseClass):
|
|||
|
||||
if self.state == 'inspect':
|
||||
self.client.module.deprecate(
|
||||
"The 'inspect' state is deprecated, please use 'docker_swarm_facts' to inspect swarm cluster",
|
||||
"The 'inspect' state is deprecated, please use 'docker_swarm_info' to inspect swarm cluster",
|
||||
version='2.12')
|
||||
|
||||
choice_map.get(self.state)()
|
||||
|
|
|
@ -13,7 +13,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: docker_swarm_facts
|
||||
module: docker_swarm_info
|
||||
|
||||
short_description: Retrieves facts about Docker Swarm cluster.
|
||||
|
||||
|
@ -73,7 +73,7 @@ options:
|
|||
- When set to C(yes) and I(nodes), I(services) or I(tasks) is set to C(yes)
|
||||
then output will contain verbose information about objects matching the full output of API method.
|
||||
For details see the documentation of your version of Docker API at U(https://docs.docker.com/engine/api/).
|
||||
- The verbose output in this module contains only subset of information returned by I(_facts) module
|
||||
- The verbose output in this module contains only subset of information returned by I(_info) module
|
||||
for each type of the objects.
|
||||
type: bool
|
||||
default: no
|
||||
|
@ -88,7 +88,7 @@ requirements:
|
|||
|
||||
EXAMPLES = '''
|
||||
- name: Get info on Docker Swarm
|
||||
docker_swarm_facts:
|
||||
docker_swarm_info:
|
||||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
|
@ -102,18 +102,18 @@ EXAMPLES = '''
|
|||
- block:
|
||||
|
||||
- name: Get info on Docker Swarm and list of registered nodes
|
||||
docker_swarm_facts:
|
||||
docker_swarm_info:
|
||||
nodes: yes
|
||||
register: result
|
||||
|
||||
- name: Get info on Docker Swarm and extended list of registered nodes
|
||||
docker_swarm_facts:
|
||||
docker_swarm_info:
|
||||
nodes: yes
|
||||
verbose_output: yes
|
||||
register: result
|
||||
|
||||
- name: Get info on Docker Swarm and filtered list of registered nodes
|
||||
docker_swarm_facts:
|
||||
docker_swarm_info:
|
||||
nodes: yes
|
||||
nodes_filter:
|
||||
name: mynode
|
|
@ -14,7 +14,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
|
||||
DOCUMENTATION = u'''
|
||||
module: docker_volume_facts
|
||||
module: docker_volume_info
|
||||
version_added: "2.8"
|
||||
short_description: Retrieve facts about Docker volumes
|
||||
description:
|
||||
|
@ -42,7 +42,7 @@ requirements:
|
|||
|
||||
EXAMPLES = '''
|
||||
- name: Get infos on volume
|
||||
docker_volume_facts:
|
||||
docker_volume_info:
|
||||
name: mydata
|
||||
register: result
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue