From 8d62794f9171e720f8a0baa3d5544848900809f2 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 21 Mar 2019 09:37:18 +0100 Subject: [PATCH] docker: rename docker_*_facts -> docker_*_info (#54124) * Rename docker_*_facts -> docker_*_info. * Add changelog. * Update scenario guide. --- .../54124-docker_image-facts-info.yml | 2 ++ .../rst/scenario_guides/guide_docker.rst | 4 +-- .../cloud/docker/_docker_image_facts.py | 1 + ...iner_facts.py => docker_container_info.py} | 4 +-- ...cker_host_facts.py => docker_host_info.py} | 14 +++++----- ...er_image_facts.py => docker_image_info.py} | 11 +++++--- ...etwork_facts.py => docker_network_info.py} | 4 +-- ...cker_node_facts.py => docker_node_info.py} | 10 +++---- .../modules/cloud/docker/docker_swarm.py | 2 +- ...er_swarm_facts.py => docker_swarm_info.py} | 12 ++++----- ..._volume_facts.py => docker_volume_info.py} | 4 +-- .../tasks/tests/image-ids.yml | 16 ++++++------ .../aliases | 0 .../meta/main.yml | 0 .../tasks/main.yml | 8 +++--- .../aliases | 0 .../meta/main.yml | 0 .../tasks/main.yml | 4 +-- .../tasks/test_host_info.yml} | 26 +++++++++---------- .../docker_image/tasks/tests/basic.yml | 6 ++--- .../docker_image/tasks/tests/options.yml | 2 +- .../aliases | 0 .../meta/main.yml | 0 .../tasks/main.yml | 8 +++--- .../aliases | 0 .../meta/main.yml | 0 .../tasks/main.yml | 8 +++--- .../targets/docker_node/tasks/test_node.yml | 8 +++--- .../aliases | 0 .../meta/main.yml | 0 .../tasks/main.yml | 6 ++--- .../tasks/test_node_info.yml} | 20 +++++++------- .../docker_swarm/tasks/tests/options-ca.yml | 2 +- .../aliases | 0 .../meta/main.yml | 0 .../tasks/main.yml | 6 ++--- .../tasks/test_swarm_info.yml} | 24 ++++++++--------- .../aliases | 0 .../meta/main.yml | 0 .../tasks/main.yml | 8 +++--- 40 files changed, 114 insertions(+), 106 deletions(-) create mode 100644 changelogs/fragments/54124-docker_image-facts-info.yml create mode 120000 lib/ansible/modules/cloud/docker/_docker_image_facts.py rename lib/ansible/modules/cloud/docker/{docker_container_facts.py => docker_container_info.py} (98%) rename lib/ansible/modules/cloud/docker/{docker_host_facts.py => docker_host_info.py} (98%) rename lib/ansible/modules/cloud/docker/{docker_image_facts.py => docker_image_info.py} (95%) rename lib/ansible/modules/cloud/docker/{docker_network_facts.py => docker_network_info.py} (98%) rename lib/ansible/modules/cloud/docker/{docker_node_facts.py => docker_node_info.py} (97%) rename lib/ansible/modules/cloud/docker/{docker_swarm_facts.py => docker_swarm_info.py} (98%) rename lib/ansible/modules/cloud/docker/{docker_volume_facts.py => docker_volume_info.py} (98%) rename test/integration/targets/{docker_container_facts => docker_container_info}/aliases (100%) rename test/integration/targets/{docker_container_facts => docker_container_info}/meta/main.yml (100%) rename test/integration/targets/{docker_container_facts => docker_container_info}/tasks/main.yml (93%) rename test/integration/targets/{docker_host_facts => docker_host_info}/aliases (100%) rename test/integration/targets/{docker_host_facts => docker_host_info}/meta/main.yml (100%) rename test/integration/targets/{docker_host_facts => docker_host_info}/tasks/main.yml (86%) rename test/integration/targets/{docker_host_facts/tasks/test_host_facts.yml => docker_host_info/tasks/test_host_info.yml} (96%) rename test/integration/targets/{docker_image_facts => docker_image_info}/aliases (100%) rename test/integration/targets/{docker_image_facts => docker_image_info}/meta/main.yml (100%) rename test/integration/targets/{docker_image_facts => docker_image_info}/tasks/main.yml (93%) rename test/integration/targets/{docker_network_facts => docker_network_info}/aliases (100%) rename test/integration/targets/{docker_network_facts => docker_network_info}/meta/main.yml (100%) rename test/integration/targets/{docker_network_facts => docker_network_info}/tasks/main.yml (93%) rename test/integration/targets/{docker_node_facts => docker_node_info}/aliases (100%) rename test/integration/targets/{docker_node_facts => docker_node_info}/meta/main.yml (100%) rename test/integration/targets/{docker_node_facts => docker_node_info}/tasks/main.yml (67%) rename test/integration/targets/{docker_node_facts/tasks/test_node_facts.yml => docker_node_info/tasks/test_node_info.yml} (79%) rename test/integration/targets/{docker_swarm_facts => docker_swarm_info}/aliases (100%) rename test/integration/targets/{docker_swarm_facts => docker_swarm_info}/meta/main.yml (100%) rename test/integration/targets/{docker_swarm_facts => docker_swarm_info}/tasks/main.yml (67%) rename test/integration/targets/{docker_swarm_facts/tasks/test_swarm_facts.yml => docker_swarm_info/tasks/test_swarm_info.yml} (82%) rename test/integration/targets/{docker_volume_facts => docker_volume_info}/aliases (100%) rename test/integration/targets/{docker_volume_facts => docker_volume_info}/meta/main.yml (100%) rename test/integration/targets/{docker_volume_facts => docker_volume_info}/tasks/main.yml (93%) diff --git a/changelogs/fragments/54124-docker_image-facts-info.yml b/changelogs/fragments/54124-docker_image-facts-info.yml new file mode 100644 index 0000000000..dbfac96c26 --- /dev/null +++ b/changelogs/fragments/54124-docker_image-facts-info.yml @@ -0,0 +1,2 @@ +minor_changes: +- The ``docker_image_facts`` module has been renamed to ``docker_image_info``. diff --git a/docs/docsite/rst/scenario_guides/guide_docker.rst b/docs/docsite/rst/scenario_guides/guide_docker.rst index 3dee691998..fb50c53226 100644 --- a/docs/docsite/rst/scenario_guides/guide_docker.rst +++ b/docs/docsite/rst/scenario_guides/guide_docker.rst @@ -14,8 +14,8 @@ Ansible offers the following modules for orchestrating Docker containers: docker_image Provides full control over images, including: build, pull, push, tag and remove. - docker_image_facts - Inspects one or more images in the Docker host's image cache, providing the information as facts for making + docker_image_info + Inspects one or more images in the Docker host's image cache, providing the information for making decision or assertions in a playbook. docker_login diff --git a/lib/ansible/modules/cloud/docker/_docker_image_facts.py b/lib/ansible/modules/cloud/docker/_docker_image_facts.py new file mode 120000 index 0000000000..f9db45b3c7 --- /dev/null +++ b/lib/ansible/modules/cloud/docker/_docker_image_facts.py @@ -0,0 +1 @@ +docker_image_info.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/docker/docker_container_facts.py b/lib/ansible/modules/cloud/docker/docker_container_info.py similarity index 98% rename from lib/ansible/modules/cloud/docker/docker_container_facts.py rename to lib/ansible/modules/cloud/docker/docker_container_info.py index 6fbe667042..72147aad00 100644 --- a/lib/ansible/modules/cloud/docker/docker_container_facts.py +++ b/lib/ansible/modules/cloud/docker/docker_container_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 diff --git a/lib/ansible/modules/cloud/docker/docker_host_facts.py b/lib/ansible/modules/cloud/docker/docker_host_info.py similarity index 98% rename from lib/ansible/modules/cloud/docker/docker_host_facts.py rename to lib/ansible/modules/cloud/docker/docker_host_info.py index 8f713879c0..2b647eb6c2 100644 --- a/lib/ansible/modules/cloud/docker/docker_host_facts.py +++ b/lib/ansible/modules/cloud/docker/docker_host_info.py @@ -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 diff --git a/lib/ansible/modules/cloud/docker/docker_image_facts.py b/lib/ansible/modules/cloud/docker/docker_image_info.py similarity index 95% rename from lib/ansible/modules/cloud/docker/docker_image_facts.py rename to lib/ansible/modules/cloud/docker/docker_image_info.py index 4f17f7f749..8c1f2151bf 100644 --- a/lib/ansible/modules/cloud/docker/docker_image_facts.py +++ b/lib/ansible/modules/cloud/docker/docker_image_info.py @@ -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, diff --git a/lib/ansible/modules/cloud/docker/docker_network_facts.py b/lib/ansible/modules/cloud/docker/docker_network_info.py similarity index 98% rename from lib/ansible/modules/cloud/docker/docker_network_facts.py rename to lib/ansible/modules/cloud/docker/docker_network_info.py index 4c89ec400f..3a7d885162 100644 --- a/lib/ansible/modules/cloud/docker/docker_network_facts.py +++ b/lib/ansible/modules/cloud/docker/docker_network_info.py @@ -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 diff --git a/lib/ansible/modules/cloud/docker/docker_node_facts.py b/lib/ansible/modules/cloud/docker/docker_node_info.py similarity index 97% rename from lib/ansible/modules/cloud/docker/docker_node_facts.py rename to lib/ansible/modules/cloud/docker/docker_node_info.py index 5ed0710f71..aab8df8ffc 100644 --- a/lib/ansible/modules/cloud/docker/docker_node_facts.py +++ b/lib/ansible/modules/cloud/docker/docker_node_info.py @@ -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 ''' diff --git a/lib/ansible/modules/cloud/docker/docker_swarm.py b/lib/ansible/modules/cloud/docker/docker_swarm.py index 176ccde0aa..f9882f89c0 100644 --- a/lib/ansible/modules/cloud/docker/docker_swarm.py +++ b/lib/ansible/modules/cloud/docker/docker_swarm.py @@ -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)() diff --git a/lib/ansible/modules/cloud/docker/docker_swarm_facts.py b/lib/ansible/modules/cloud/docker/docker_swarm_info.py similarity index 98% rename from lib/ansible/modules/cloud/docker/docker_swarm_facts.py rename to lib/ansible/modules/cloud/docker/docker_swarm_info.py index e5c11c59c3..0302aff8fa 100644 --- a/lib/ansible/modules/cloud/docker/docker_swarm_facts.py +++ b/lib/ansible/modules/cloud/docker/docker_swarm_info.py @@ -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 diff --git a/lib/ansible/modules/cloud/docker/docker_volume_facts.py b/lib/ansible/modules/cloud/docker/docker_volume_info.py similarity index 98% rename from lib/ansible/modules/cloud/docker/docker_volume_facts.py rename to lib/ansible/modules/cloud/docker/docker_volume_info.py index a9a6f7be03..58edd15293 100644 --- a/lib/ansible/modules/cloud/docker/docker_volume_facts.py +++ b/lib/ansible/modules/cloud/docker/docker_volume_info.py @@ -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 diff --git a/test/integration/targets/docker_container/tasks/tests/image-ids.yml b/test/integration/targets/docker_container/tasks/tests/image-ids.yml index d305904868..9aee882945 100644 --- a/test/integration/targets/docker_container/tasks/tests/image-ids.yml +++ b/test/integration/targets/docker_container/tasks/tests/image-ids.yml @@ -17,23 +17,23 @@ loop_var: image - name: Get image ID of hello-world and alpine images - docker_image_facts: + docker_image_info: name: - "hello-world:latest" - "alpine:3.8" - register: image_facts + register: image_info - assert: that: - - image_facts.images | length == 2 + - image_info.images | length == 2 - name: Print image IDs debug: - msg: "hello-world: {{ image_facts.images[0].Id }}; alpine: {{ image_facts.images[1].Id }}" + msg: "hello-world: {{ image_info.images[0].Id }}; alpine: {{ image_info.images[1].Id }}" - name: Create container with hello-world image via ID docker_container: - image: "{{ image_facts.images[0].Id }}" + image: "{{ image_info.images[0].Id }}" name: "{{ cname }}" state: present force_kill: yes @@ -41,7 +41,7 @@ - name: Create container with hello-world image via ID (idempotent) docker_container: - image: "{{ image_facts.images[0].Id }}" + image: "{{ image_info.images[0].Id }}" name: "{{ cname }}" state: present force_kill: yes @@ -49,7 +49,7 @@ - name: Create container with alpine image via ID docker_container: - image: "{{ image_facts.images[1].Id }}" + image: "{{ image_info.images[1].Id }}" name: "{{ cname }}" state: present force_kill: yes @@ -57,7 +57,7 @@ - name: Create container with alpine image via ID (idempotent) docker_container: - image: "{{ image_facts.images[1].Id }}" + image: "{{ image_info.images[1].Id }}" name: "{{ cname }}" state: present force_kill: yes diff --git a/test/integration/targets/docker_container_facts/aliases b/test/integration/targets/docker_container_info/aliases similarity index 100% rename from test/integration/targets/docker_container_facts/aliases rename to test/integration/targets/docker_container_info/aliases diff --git a/test/integration/targets/docker_container_facts/meta/main.yml b/test/integration/targets/docker_container_info/meta/main.yml similarity index 100% rename from test/integration/targets/docker_container_facts/meta/main.yml rename to test/integration/targets/docker_container_info/meta/main.yml diff --git a/test/integration/targets/docker_container_facts/tasks/main.yml b/test/integration/targets/docker_container_info/tasks/main.yml similarity index 93% rename from test/integration/targets/docker_container_facts/tasks/main.yml rename to test/integration/targets/docker_container_info/tasks/main.yml index 5cb029ba96..a31dc32349 100644 --- a/test/integration/targets/docker_container_facts/tasks/main.yml +++ b/test/integration/targets/docker_container_info/tasks/main.yml @@ -11,7 +11,7 @@ force_kill: yes - name: Inspect a non-present container - docker_container_facts: + docker_container_info: name: "{{ cname }}" register: result @@ -31,10 +31,10 @@ force_kill: yes - name: Inspect a present container - docker_container_facts: + docker_container_info: name: "{{ cname }}" register: result - - name: Dump docker_container_facts result + - name: Dump docker_container_info result debug: var=result - name: "Comparison: use 'docker inspect'" @@ -60,5 +60,5 @@ when: docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.20', '>=') -- fail: msg="Too old docker / docker-py version to run docker_container_facts tests!" +- fail: msg="Too old docker / docker-py version to run docker_container_info tests!" when: not(docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.20', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6) diff --git a/test/integration/targets/docker_host_facts/aliases b/test/integration/targets/docker_host_info/aliases similarity index 100% rename from test/integration/targets/docker_host_facts/aliases rename to test/integration/targets/docker_host_info/aliases diff --git a/test/integration/targets/docker_host_facts/meta/main.yml b/test/integration/targets/docker_host_info/meta/main.yml similarity index 100% rename from test/integration/targets/docker_host_facts/meta/main.yml rename to test/integration/targets/docker_host_info/meta/main.yml diff --git a/test/integration/targets/docker_host_facts/tasks/main.yml b/test/integration/targets/docker_host_info/tasks/main.yml similarity index 86% rename from test/integration/targets/docker_host_facts/tasks/main.yml rename to test/integration/targets/docker_host_info/tasks/main.yml index 454ebfd327..6779b5fc42 100644 --- a/test/integration/targets/docker_host_facts/tasks/main.yml +++ b/test/integration/targets/docker_host_info/tasks/main.yml @@ -1,5 +1,5 @@ -- include_tasks: test_host_facts.yml +- include_tasks: test_host_info.yml when: docker_py_version is version('1.10.0', '>=') and docker_api_version is version('1.21', '>=') -- fail: msg="Too old docker / docker-py version to run docker_host_facts tests!" +- fail: msg="Too old docker / docker-py version to run docker_host_info tests!" when: not(docker_py_version is version('1.10.0', '>=') and docker_api_version is version('1.21', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6) diff --git a/test/integration/targets/docker_host_facts/tasks/test_host_facts.yml b/test/integration/targets/docker_host_info/tasks/test_host_info.yml similarity index 96% rename from test/integration/targets/docker_host_facts/tasks/test_host_facts.yml rename to test/integration/targets/docker_host_info/tasks/test_host_info.yml index cd945112fd..fa5bc686cf 100644 --- a/test/integration/targets/docker_host_facts/tasks/test_host_facts.yml +++ b/test/integration/targets/docker_host_info/tasks/test_host_info.yml @@ -9,7 +9,7 @@ - block: - name: Get info on Docker host - docker_host_facts: + docker_host_info: register: output - name: assert reading docker host facts when docker is running @@ -48,7 +48,7 @@ - volume_output is changed - name: Get info on Docker host and list containers - docker_host_facts: + docker_host_info: containers: yes register: output @@ -64,7 +64,7 @@ - 'output.containers[0].ImageID is not defined' - name: Get info on Docker host and list containers with verbose output - docker_host_facts: + docker_host_info: containers: yes verbose_output: yes register: output @@ -81,7 +81,7 @@ - 'output.containers[0].ImageID is string' - name: Get info on Docker host and list images - docker_host_facts: + docker_host_info: images: yes register: output @@ -97,7 +97,7 @@ - 'output.disk_usage is not defined' - name: Get info on Docker host and list images with verbose output - docker_host_facts: + docker_host_info: images: yes verbose_output: yes register: output @@ -114,7 +114,7 @@ - 'output.disk_usage is not defined' - name: Get info on Docker host and list networks - docker_host_facts: + docker_host_info: networks: yes register: output @@ -130,7 +130,7 @@ - 'output.disk_usage is not defined' - name: Get info on Docker host and list networks with verbose output - docker_host_facts: + docker_host_info: networks: yes verbose_output: yes register: output @@ -147,7 +147,7 @@ - 'output.disk_usage is not defined' - name: Get info on Docker host and list volumes - docker_host_facts: + docker_host_info: volumes: yes register: output @@ -163,7 +163,7 @@ - 'output.disk_usage is not defined' - name: Get info on Docker host and list volumes with verbose output - docker_host_facts: + docker_host_info: volumes: yes verbose_output: yes register: output @@ -180,7 +180,7 @@ - 'output.disk_usage is not defined' - name: Get info on Docker host and get disk usage - docker_host_facts: + docker_host_info: disk_usage: yes register: output @@ -196,7 +196,7 @@ - 'output.disk_usage.BuilderSize is not defined' - name: Get info on Docker host and get disk usage with verbose output - docker_host_facts: + docker_host_info: disk_usage: yes verbose_output: yes register: output @@ -213,7 +213,7 @@ - 'output.disk_usage.BuilderSize is number' - name: Get info on Docker host, disk usage and get all lists together - docker_host_facts: + docker_host_info: volumes: yes containers: yes networks: yes @@ -237,7 +237,7 @@ - 'output.disk_usage.BuilderSize is not defined' - name: Get info on Docker host, disk usage and get all lists together with verbose output - docker_host_facts: + docker_host_info: volumes: yes containers: yes networks: yes diff --git a/test/integration/targets/docker_image/tasks/tests/basic.yml b/test/integration/targets/docker_image/tasks/tests/basic.yml index c503b13cb0..53195294e0 100644 --- a/test/integration/targets/docker_image/tasks/tests/basic.yml +++ b/test/integration/targets/docker_image/tasks/tests/basic.yml @@ -115,7 +115,7 @@ - push_3 is not changed - name: Get facts of local image - docker_image_facts: + docker_image_info: name: "{{ registry_address }}/test/hello-world:latest" register: facts_1 @@ -126,7 +126,7 @@ force_absent: yes - name: Get facts of local image (absent) - docker_image_facts: + docker_image_info: name: "{{ registry_address }}/test/hello-world:latest" register: facts_2 @@ -145,7 +145,7 @@ register: pull_2 - name: Get facts of local image (present) - docker_image_facts: + docker_image_info: name: "{{ registry_address }}/test/hello-world:latest" register: facts_3 diff --git a/test/integration/targets/docker_image/tasks/tests/options.yml b/test/integration/targets/docker_image/tasks/tests/options.yml index a46b531da6..76975a8566 100644 --- a/test/integration/targets/docker_image/tasks/tests/options.yml +++ b/test/integration/targets/docker_image/tasks/tests/options.yml @@ -162,7 +162,7 @@ - repository_2 is not changed - name: Get facts of image - docker_image_facts: + docker_image_info: name: "{{ registry_address }}/test/{{ iname }}:latest" register: facts_1 diff --git a/test/integration/targets/docker_image_facts/aliases b/test/integration/targets/docker_image_info/aliases similarity index 100% rename from test/integration/targets/docker_image_facts/aliases rename to test/integration/targets/docker_image_info/aliases diff --git a/test/integration/targets/docker_image_facts/meta/main.yml b/test/integration/targets/docker_image_info/meta/main.yml similarity index 100% rename from test/integration/targets/docker_image_facts/meta/main.yml rename to test/integration/targets/docker_image_info/meta/main.yml diff --git a/test/integration/targets/docker_image_facts/tasks/main.yml b/test/integration/targets/docker_image_info/tasks/main.yml similarity index 93% rename from test/integration/targets/docker_image_facts/tasks/main.yml rename to test/integration/targets/docker_image_info/tasks/main.yml index 5eb25004aa..be7f7e8d9c 100644 --- a/test/integration/targets/docker_image_facts/tasks/main.yml +++ b/test/integration/targets/docker_image_info/tasks/main.yml @@ -6,7 +6,7 @@ state: absent - name: Inspect a non-available image - docker_image_facts: + docker_image_info: name: alpine:3.7 register: result @@ -24,7 +24,7 @@ - "alpine:3.8" - name: Inspect an available image - docker_image_facts: + docker_image_info: name: hello-world:latest register: result @@ -34,7 +34,7 @@ - "'hello-world:latest' in result.images[0].RepoTags" - name: Inspect multiple images - docker_image_facts: + docker_image_info: name: - "hello-world:latest" - "alpine:3.8" @@ -50,5 +50,5 @@ when: docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.20', '>=') -- fail: msg="Too old docker / docker-py version to run docker_image_facts tests!" +- fail: msg="Too old docker / docker-py version to run docker_image_info tests!" when: not(docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.20', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6) diff --git a/test/integration/targets/docker_network_facts/aliases b/test/integration/targets/docker_network_info/aliases similarity index 100% rename from test/integration/targets/docker_network_facts/aliases rename to test/integration/targets/docker_network_info/aliases diff --git a/test/integration/targets/docker_network_facts/meta/main.yml b/test/integration/targets/docker_network_info/meta/main.yml similarity index 100% rename from test/integration/targets/docker_network_facts/meta/main.yml rename to test/integration/targets/docker_network_info/meta/main.yml diff --git a/test/integration/targets/docker_network_facts/tasks/main.yml b/test/integration/targets/docker_network_info/tasks/main.yml similarity index 93% rename from test/integration/targets/docker_network_facts/tasks/main.yml rename to test/integration/targets/docker_network_info/tasks/main.yml index ee08c65bdd..f8bce0ebcc 100644 --- a/test/integration/targets/docker_network_facts/tasks/main.yml +++ b/test/integration/targets/docker_network_info/tasks/main.yml @@ -11,7 +11,7 @@ force: yes - name: Inspect a non-present network - docker_network_facts: + docker_network_info: name: "{{ nname }}" register: result @@ -27,10 +27,10 @@ state: present - name: Inspect a present network - docker_network_facts: + docker_network_info: name: "{{ nname }}" register: result - - name: Dump docker_network_facts result + - name: Dump docker_network_info result debug: var=result - name: "Comparison: use 'docker network inspect'" @@ -56,5 +56,5 @@ when: docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.21', '>=') -- fail: msg="Too old docker / docker-py version to run docker_network_facts tests!" +- fail: msg="Too old docker / docker-py version to run docker_network_info tests!" when: not(docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.21', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6) diff --git a/test/integration/targets/docker_node/tasks/test_node.yml b/test/integration/targets/docker_node/tasks/test_node.yml index c362fc3767..6f3e5f56ce 100644 --- a/test/integration/targets/docker_node/tasks/test_node.yml +++ b/test/integration/targets/docker_node/tasks/test_node.yml @@ -5,8 +5,8 @@ state: absent force: true - - name: Try to get docker_node_facts when docker is not running in swarm mode - docker_node_facts: + - name: Try to get docker_node_info when docker is not running in swarm mode + docker_node_info: ignore_errors: yes register: output @@ -29,8 +29,8 @@ - 'output.swarm_facts.JoinTokens.Manager' - 'output.swarm_facts.JoinTokens.Worker' - - name: Try to get docker_node_facts when docker is running in swarm mode and as manager - docker_node_facts: + - name: Try to get docker_node_info when docker is running in swarm mode and as manager + docker_node_info: register: output - name: assert reading docker swarm node facts diff --git a/test/integration/targets/docker_node_facts/aliases b/test/integration/targets/docker_node_info/aliases similarity index 100% rename from test/integration/targets/docker_node_facts/aliases rename to test/integration/targets/docker_node_info/aliases diff --git a/test/integration/targets/docker_node_facts/meta/main.yml b/test/integration/targets/docker_node_info/meta/main.yml similarity index 100% rename from test/integration/targets/docker_node_facts/meta/main.yml rename to test/integration/targets/docker_node_info/meta/main.yml diff --git a/test/integration/targets/docker_node_facts/tasks/main.yml b/test/integration/targets/docker_node_info/tasks/main.yml similarity index 67% rename from test/integration/targets/docker_node_facts/tasks/main.yml rename to test/integration/targets/docker_node_info/tasks/main.yml index fb81d964f3..4d1e6a4c88 100644 --- a/test/integration/targets/docker_node_facts/tasks/main.yml +++ b/test/integration/targets/docker_node_info/tasks/main.yml @@ -1,6 +1,6 @@ -- include_tasks: test_node_facts.yml - # Maximum of 1.24 (docker API version for docker_node_facts) and 1.25 (docker API version for docker_swarm) is 1.25 +- include_tasks: test_node_info.yml + # Maximum of 1.24 (docker API version for docker_node_info) and 1.25 (docker API version for docker_swarm) is 1.25 when: docker_py_version is version('2.4.0', '>=') and docker_api_version is version('1.25', '>=') -- fail: msg="Too old docker / docker-py version to run docker_node_facts tests!" +- fail: msg="Too old docker / docker-py version to run docker_node_info tests!" when: not(docker_py_version is version('2.4.0', '>=') and docker_api_version is version('1.25', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6) diff --git a/test/integration/targets/docker_node_facts/tasks/test_node_facts.yml b/test/integration/targets/docker_node_info/tasks/test_node_info.yml similarity index 79% rename from test/integration/targets/docker_node_facts/tasks/test_node_facts.yml rename to test/integration/targets/docker_node_info/tasks/test_node_info.yml index 8a8eeb713a..3cdd06e90b 100644 --- a/test/integration/targets/docker_node_facts/tasks/test_node_facts.yml +++ b/test/integration/targets/docker_node_info/tasks/test_node_info.yml @@ -5,8 +5,8 @@ state: absent force: true - - name: Try to get docker_node_facts when docker is not running in swarm mode - docker_node_facts: + - name: Try to get docker_node_info when docker is not running in swarm mode + docker_node_info: ignore_errors: yes register: output @@ -29,8 +29,8 @@ - 'output.swarm_facts.JoinTokens.Manager' - 'output.swarm_facts.JoinTokens.Worker' - - name: Try to get docker_node_facts when docker is running in swarm mode and as manager - docker_node_facts: + - name: Try to get docker_node_info when docker is running in swarm mode and as manager + docker_node_info: register: output - name: assert reading docker swarm node facts @@ -39,8 +39,8 @@ - 'output.nodes | length > 0' - 'output.nodes[0].ID is string' - - name: Try to get docker_node_facts using the self parameter - docker_node_facts: + - name: Try to get docker_node_info using the self parameter + docker_node_info: self: yes register: output @@ -55,8 +55,8 @@ localnodename: "{{ output.nodes[0].Description.Hostname }}" - - name: Try to get docker_node_facts using the local node name as parameter - docker_node_facts: + - name: Try to get docker_node_info using the local node name as parameter + docker_node_info: name: "{{ localnodename }}" register: output @@ -70,8 +70,8 @@ set_fact: randomnodename: "{{ 'node-%0x' % ((2**32) | random) }}" - - name: Try to get docker_node_facts using random node name as parameter - docker_node_facts: + - name: Try to get docker_node_info using random node name as parameter + docker_node_info: name: "{{ randomnodename }}" register: output diff --git a/test/integration/targets/docker_swarm/tasks/tests/options-ca.yml b/test/integration/targets/docker_swarm/tasks/tests/options-ca.yml index e175cc0f41..47baafca6a 100644 --- a/test/integration/targets/docker_swarm/tasks/tests/options-ca.yml +++ b/test/integration/targets/docker_swarm/tasks/tests/options-ca.yml @@ -67,7 +67,7 @@ debug: msg="{{ lookup('file', output_dir ~ '/ansible_key1.key') }}" - name: Cert debug: msg="{{ lookup('file', output_dir ~ '/ansible_key1.pem') }}" - - docker_swarm_facts: + - docker_swarm_info: register: output ignore_errors: yes - debug: var=output diff --git a/test/integration/targets/docker_swarm_facts/aliases b/test/integration/targets/docker_swarm_info/aliases similarity index 100% rename from test/integration/targets/docker_swarm_facts/aliases rename to test/integration/targets/docker_swarm_info/aliases diff --git a/test/integration/targets/docker_swarm_facts/meta/main.yml b/test/integration/targets/docker_swarm_info/meta/main.yml similarity index 100% rename from test/integration/targets/docker_swarm_facts/meta/main.yml rename to test/integration/targets/docker_swarm_info/meta/main.yml diff --git a/test/integration/targets/docker_swarm_facts/tasks/main.yml b/test/integration/targets/docker_swarm_info/tasks/main.yml similarity index 67% rename from test/integration/targets/docker_swarm_facts/tasks/main.yml rename to test/integration/targets/docker_swarm_info/tasks/main.yml index 22951d6379..83e9d5eb22 100644 --- a/test/integration/targets/docker_swarm_facts/tasks/main.yml +++ b/test/integration/targets/docker_swarm_info/tasks/main.yml @@ -1,6 +1,6 @@ -- include_tasks: test_swarm_facts.yml - # Maximum of 1.24 (docker API version for docker_swarm_facts) and 1.25 (docker API version for docker_swarm) is 1.25 +- include_tasks: test_swarm_info.yml + # Maximum of 1.24 (docker API version for docker_swarm_info) and 1.25 (docker API version for docker_swarm) is 1.25 when: docker_py_version is version('1.10.0', '>=') and docker_api_version is version('1.25', '>=') -- fail: msg="Too old docker / docker-py version to run docker_swarm_facts tests!" +- fail: msg="Too old docker / docker-py version to run docker_swarm_info tests!" when: not(docker_py_version is version('1.10.0', '>=') and docker_api_version is version('1.25', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6) diff --git a/test/integration/targets/docker_swarm_facts/tasks/test_swarm_facts.yml b/test/integration/targets/docker_swarm_info/tasks/test_swarm_info.yml similarity index 82% rename from test/integration/targets/docker_swarm_facts/tasks/test_swarm_facts.yml rename to test/integration/targets/docker_swarm_info/tasks/test_swarm_info.yml index 8f84c8c8f2..8710f79080 100644 --- a/test/integration/targets/docker_swarm_facts/tasks/test_swarm_facts.yml +++ b/test/integration/targets/docker_swarm_info/tasks/test_swarm_info.yml @@ -5,8 +5,8 @@ state: absent force: true - - name: Try to get docker_swarm_facts when docker is not running in swarm mode - docker_swarm_facts: + - name: Try to get docker_swarm_info when docker is not running in swarm mode + docker_swarm_info: ignore_errors: yes register: output @@ -32,8 +32,8 @@ - 'output.swarm_facts.JoinTokens.Manager' - 'output.swarm_facts.JoinTokens.Worker' - - name: Try to get docker_swarm_facts when docker is running in swarm mode and as manager - docker_swarm_facts: + - name: Try to get docker_swarm_info when docker is running in swarm mode and as manager + docker_swarm_info: register: output - name: assert creding docker swarm facts @@ -46,8 +46,8 @@ - 'output.docker_swarm_active == true' - 'output.docker_swarm_manager == true' - - name: Try to get docker_swarm_facts and list of nodes when docker is running in swarm mode and as manager - docker_swarm_facts: + - name: Try to get docker_swarm_info and list of nodes when docker is running in swarm mode and as manager + docker_swarm_info: nodes: yes register: output @@ -67,8 +67,8 @@ localnodename: "{{ output.nodes[0].Hostname }}" - - name: Try to get docker_swarm_facts and verbose list of nodes when docker is running in swarm mode and as manager - docker_swarm_facts: + - name: Try to get docker_swarm_info and verbose list of nodes when docker is running in swarm mode and as manager + docker_swarm_info: nodes: yes verbose_output: yes register: output @@ -85,8 +85,8 @@ - 'output.docker_swarm_active == true' - 'output.docker_swarm_manager == true' - - name: Try to get docker_swarm_facts and list of nodes with filters providing existing node name - docker_swarm_facts: + - name: Try to get docker_swarm_info and list of nodes with filters providing existing node name + docker_swarm_info: nodes: yes nodes_filters: name: "{{ localnodename }}" @@ -107,8 +107,8 @@ set_fact: randomnodename: "{{ 'node-%0x' % ((2**32) | random) }}" - - name: Try to get docker_swarm_facts and list of nodes with filters providing non-existing random node name - docker_swarm_facts: + - name: Try to get docker_swarm_info and list of nodes with filters providing non-existing random node name + docker_swarm_info: nodes: yes nodes_filters: name: "{{ randomnodename }}" diff --git a/test/integration/targets/docker_volume_facts/aliases b/test/integration/targets/docker_volume_info/aliases similarity index 100% rename from test/integration/targets/docker_volume_facts/aliases rename to test/integration/targets/docker_volume_info/aliases diff --git a/test/integration/targets/docker_volume_facts/meta/main.yml b/test/integration/targets/docker_volume_info/meta/main.yml similarity index 100% rename from test/integration/targets/docker_volume_facts/meta/main.yml rename to test/integration/targets/docker_volume_info/meta/main.yml diff --git a/test/integration/targets/docker_volume_facts/tasks/main.yml b/test/integration/targets/docker_volume_info/tasks/main.yml similarity index 93% rename from test/integration/targets/docker_volume_facts/tasks/main.yml rename to test/integration/targets/docker_volume_info/tasks/main.yml index 2b10f7b78f..26b14a6599 100644 --- a/test/integration/targets/docker_volume_facts/tasks/main.yml +++ b/test/integration/targets/docker_volume_info/tasks/main.yml @@ -10,7 +10,7 @@ state: absent - name: Inspect a non-present volume - docker_volume_facts: + docker_volume_info: name: "{{ cname }}" register: result @@ -25,10 +25,10 @@ name: "{{ cname }}" - name: Inspect a present volume - docker_volume_facts: + docker_volume_info: name: "{{ cname }}" register: result - - name: Dump docker_volume_facts result + - name: Dump docker_volume_info result debug: var=result - name: "Comparison: use 'docker volume inspect'" @@ -54,5 +54,5 @@ # Requirements for docker_volume when: docker_py_version is version('1.10.0', '>=') and docker_api_version is version('1.24', '>=') -- fail: msg="Too old docker / docker-py version to run docker_volume_facts tests!" +- fail: msg="Too old docker / docker-py version to run docker_volume_info tests!" when: not(docker_py_version is version('1.10.0', '>=') and docker_api_version is version('1.24', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6)