diff --git a/meta/runtime.yml b/meta/runtime.yml index 4410e00c..c7d94dda 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -6,26 +6,26 @@ requires_ansible: '>=2.11.0' action_groups: docker: - - docker_compose - - docker_config - - docker_container - - docker_container_exec - - docker_container_info - - docker_host_info - - docker_image - - docker_image_info - - docker_image_load - - docker_login - - docker_network - - docker_network_info - - docker_node - - docker_node_info - - docker_plugin - - docker_prune - - docker_secret - - docker_swarm - - docker_swarm_info - - docker_swarm_service - - docker_swarm_service_info - - docker_volume - - docker_volume_info + - docker_compose + - docker_config + - docker_container + - docker_container_exec + - docker_container_info + - docker_host_info + - docker_image + - docker_image_info + - docker_image_load + - docker_login + - docker_network + - docker_network_info + - docker_node + - docker_node_info + - docker_plugin + - docker_prune + - docker_secret + - docker_swarm + - docker_swarm_info + - docker_swarm_service + - docker_swarm_service_info + - docker_volume + - docker_volume_info diff --git a/plugins/connection/docker.py b/plugins/connection/docker.py index 6e7d0790..ba224929 100644 --- a/plugins/connection/docker.py +++ b/plugins/connection/docker.py @@ -11,19 +11,19 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - author: - - Lorin Hochestein (!UNKNOWN) - - Leendert Brouwer (!UNKNOWN) - name: docker - short_description: Run tasks in docker containers - description: - - Run commands or put/fetch files to an existing docker container. - - Uses the Docker CLI to execute commands in the container. If you prefer - to directly connect to the Docker daemon, use the - R(community.docker.docker_api,ansible_collections.community.docker.docker_api_connection) - connection plugin. - options: - remote_addr: +author: + - Lorin Hochestein (!UNKNOWN) + - Leendert Brouwer (!UNKNOWN) +name: docker +short_description: Run tasks in docker containers +description: + - Run commands or put/fetch files to an existing docker container. + - Uses the Docker CLI to execute commands in the container. If you prefer + to directly connect to the Docker daemon, use the + R(community.docker.docker_api,ansible_collections.community.docker.docker_api_connection) + connection plugin. +options: + remote_addr: description: - The name of the container you want to access. default: inventory_hostname @@ -31,7 +31,7 @@ DOCUMENTATION = ''' - name: inventory_hostname - name: ansible_host - name: ansible_docker_host - remote_user: + remote_user: description: - The user to execute as inside the container. - If Docker is too old to allow this (< 1.7), the one set by Docker itself will be used. @@ -47,7 +47,7 @@ DOCUMENTATION = ''' - name: user keyword: - name: remote_user - docker_extra_args: + docker_extra_args: description: - Extra arguments to pass to the docker command line. default: '' @@ -56,7 +56,7 @@ DOCUMENTATION = ''' ini: - section: docker_connection key: extra_cli_args - container_timeout: + container_timeout: default: 10 description: - Controls how long we can wait to access reading output from the container once execution started. diff --git a/plugins/connection/docker_api.py b/plugins/connection/docker_api.py index 888c62e4..1a48f084 100644 --- a/plugins/connection/docker_api.py +++ b/plugins/connection/docker_api.py @@ -17,6 +17,9 @@ description: directly with the Docker daemon instead of using the Docker CLI. Use the R(community.docker.docker,ansible_collections.community.docker.docker_connection) connection plugin if you want to use the Docker CLI. +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.docker.var_names options: remote_user: type: str @@ -63,10 +66,6 @@ options: cli: - name: timeout type: integer - -extends_documentation_fragment: - - community.docker.docker.api_documentation - - community.docker.docker.var_names ''' import io diff --git a/plugins/connection/nsenter.py b/plugins/connection/nsenter.py index dd437780..cf4da824 100644 --- a/plugins/connection/nsenter.py +++ b/plugins/connection/nsenter.py @@ -9,38 +9,38 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - name: nsenter - short_description: execute on host running controller container - version_added: 1.9.0 - description: - - This connection plugin allows Ansible, running in a privileged container, to execute tasks on the container - host instead of in the container itself. - - This is useful for running Ansible in a pull model, while still keeping the Ansible control node - containerized. - - It relies on having privileged access to run C(nsenter) in the host's PID namespace, allowing it to enter the - namespaces of the provided PID (default PID 1, or init/systemd). - author: Jeff Goldschrafe (@jgoldschrafe) - options: - nsenter_pid: - description: - - PID to attach with using nsenter. - - The default should be fine unless you are attaching as a non-root user. - type: int - default: 1 - vars: - - name: ansible_nsenter_pid - env: - - name: ANSIBLE_NSENTER_PID - ini: - - section: nsenter_connection - key: nsenter_pid - notes: - - The remote user is ignored; this plugin always runs as root. - - >- - This plugin requires the Ansible controller container to be launched in the following way: - (1) The container image contains the C(nsenter) program; - (2) The container is launched in privileged mode; - (3) The container is launched in the host's PID namespace (C(--pid host)). +name: nsenter +short_description: execute on host running controller container +version_added: 1.9.0 +description: + - This connection plugin allows Ansible, running in a privileged container, to execute tasks on the container + host instead of in the container itself. + - This is useful for running Ansible in a pull model, while still keeping the Ansible control node + containerized. + - It relies on having privileged access to run C(nsenter) in the host's PID namespace, allowing it to enter the + namespaces of the provided PID (default PID 1, or init/systemd). +author: Jeff Goldschrafe (@jgoldschrafe) +options: + nsenter_pid: + description: + - PID to attach with using nsenter. + - The default should be fine unless you are attaching as a non-root user. + type: int + default: 1 + vars: + - name: ansible_nsenter_pid + env: + - name: ANSIBLE_NSENTER_PID + ini: + - section: nsenter_connection + key: nsenter_pid +notes: + - The remote user is ignored; this plugin always runs as root. + - >- + This plugin requires the Ansible controller container to be launched in the following way: + (1) The container image contains the C(nsenter) program; + (2) The container is launched in privileged mode; + (3) The container is launched in the host's PID namespace (C(--pid host)). ''' import os diff --git a/plugins/doc_fragments/attributes.py b/plugins/doc_fragments/attributes.py new file mode 100644 index 00000000..00b3319f --- /dev/null +++ b/plugins/doc_fragments/attributes.py @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + + +class ModuleDocFragment(object): + + # Standard documentation fragment + DOCUMENTATION = r''' +options: {} +attributes: + check_mode: + description: Can run in C(check_mode) and return changed status prediction without modifying target. + diff_mode: + description: Will return details on what has changed (or possibly needs changing in C(check_mode)), when in diff mode. +''' + + # Should be used together with the standard fragment + INFO_MODULE = r''' +options: {} +attributes: + check_mode: + support: full + details: + - This action does not modify state. + diff_mode: + support: N/A + details: + - This action does not modify state. +''' + + ACTIONGROUP_DOCKER = r''' +options: {} +attributes: + action_group: + description: Use C(group/docker) or C(group/community.docker.docker) in C(module_defaults) to set defaults for this module. + support: full + membership: + - community.docker.docker + - docker +''' + + CONN = r''' +options: {} +attributes: + become: + description: Is usable alongside C(become) keywords. + connection: + description: Uses the target's configured connection information to execute code on it. + delegation: + description: Can be used in conjunction with C(delegate_to) and related keywords. +''' + + FACTS = r''' +options: {} +attributes: + facts: + description: Action returns an C(ansible_facts) dictionary that will update existing host facts. +''' + + # Should be used together with the standard fragment and the FACTS fragment + FACTS_MODULE = r''' +options: {} +attributes: + check_mode: + support: full + details: + - This action does not modify state. + diff_mode: + support: N/A + details: + - This action does not modify state. + facts: + support: full +''' + + FILES = r''' +options: {} +attributes: + safe_file_operations: + description: Uses Ansible's strict file operation functions to ensure proper permissions and avoid data corruption. +''' + + FLOW = r''' +options: {} +attributes: + action: + description: Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller. + async: + description: Supports being used with the C(async) keyword. +''' diff --git a/plugins/modules/current_container_facts.py b/plugins/modules/current_container_facts.py index d91d9c5e..6876e735 100644 --- a/plugins/modules/current_container_facts.py +++ b/plugins/modules/current_container_facts.py @@ -18,6 +18,10 @@ description: - Return facts about whether the module runs in a Docker container. author: - Felix Fontein (@felixfontein) +extends_documentation_fragment: + - community.docker.attributes + - community.docker.attributes.facts + - community.docker.attributes.facts_module ''' EXAMPLES = ''' diff --git a/plugins/modules/docker_compose.py b/plugins/modules/docker_compose.py index ac702af7..96e997df 100644 --- a/plugins/modules/docker_compose.py +++ b/plugins/modules/docker_compose.py @@ -14,7 +14,6 @@ module: docker_compose short_description: Manage multi-container Docker applications with Docker Compose. - author: "Chris Houseknecht (@chouseknecht)" description: @@ -24,6 +23,18 @@ description: - Supports check mode. - This module was called C(docker_service) before Ansible 2.8. The usage did not change. +extends_documentation_fragment: + - community.docker.docker + - community.docker.docker.docker_py_1_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + diff_mode: + support: none + options: project_src: description: @@ -172,11 +183,6 @@ options: description: - Currently ignored for this module, but might suddenly be supported later on. -extends_documentation_fragment: - - community.docker.docker - - community.docker.docker.docker_py_1_documentation - - requirements: - "L(Docker SDK for Python,https://docker-py.readthedocs.io/en/stable/) >= 1.8.0" - "docker-compose >= 1.7.0, < 2.0.0" diff --git a/plugins/modules/docker_config.py b/plugins/modules/docker_config.py index 05bd0d0f..9f55e0f0 100644 --- a/plugins/modules/docker_config.py +++ b/plugins/modules/docker_config.py @@ -14,13 +14,25 @@ module: docker_config short_description: Manage docker configs. - description: - - Create and remove Docker configs in a Swarm environment. Similar to C(docker config create) and C(docker config rm). - - Adds to the metadata of new configs 'ansible_key', an encrypted hash representation of the data, which is then used - in future runs to test if a config has changed. If 'ansible_key' is not present, then a config will not be updated - unless the I(force) option is set. - - Updates to configs are performed by removing the config and creating it again. + - Create and remove Docker configs in a Swarm environment. Similar to C(docker config create) and C(docker config rm). + - Adds to the metadata of new configs 'ansible_key', an encrypted hash representation of the data, which is then used + in future runs to test if a config has changed. If 'ansible_key' is not present, then a config will not be updated + unless the I(force) option is set. + - Updates to configs are performed by removing the config and creating it again. + +extends_documentation_fragment: + - community.docker.docker + - community.docker.docker.docker_py_2_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + diff_mode: + support: none + options: data: description: @@ -88,11 +100,6 @@ options: - golang version_added: 2.5.0 -extends_documentation_fragment: -- community.docker.docker -- community.docker.docker.docker_py_2_documentation - - requirements: - "L(Docker SDK for Python,https://docker-py.readthedocs.io/en/stable/) >= 2.6.0" - "Docker API >= 1.30" diff --git a/plugins/modules/docker_container.py b/plugins/modules/docker_container.py index 5d7a13c6..76e10b98 100644 --- a/plugins/modules/docker_container.py +++ b/plugins/modules/docker_container.py @@ -18,7 +18,6 @@ description: - Manage the life cycle of Docker containers. - Supports check mode. Run with C(--check) and C(--diff) to view config difference and list of actions to be taken. - notes: - For most config changes, the container needs to be recreated. This means that the existing container has to be destroyed and a new one created. This can cause unexpected data loss and downtime. You can use the I(comparisons) option to @@ -27,6 +26,20 @@ notes: new container (except I(image)). Therefore, always specify B(all) options relevant to the container. - When I(restart) is set to C(true), the module will only restart the container if no config changes are detected. +extends_documentation_fragment: + - community.docker.docker + - community.docker.docker.docker_py_1_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: partial + details: + - When trying to pull an image, the module assumes this is always changed in check mode. + diff_mode: + support: full + options: auto_remove: description: @@ -929,10 +942,6 @@ options: description: - Path to the working directory. type: str -extends_documentation_fragment: -- community.docker.docker -- community.docker.docker.docker_py_1_documentation - author: - "Cove Schneider (@cove)" diff --git a/plugins/modules/docker_container_exec.py b/plugins/modules/docker_container_exec.py index 76409963..003cc252 100644 --- a/plugins/modules/docker_container_exec.py +++ b/plugins/modules/docker_container_exec.py @@ -19,6 +19,17 @@ version_added: 1.5.0 description: - Executes a command in a Docker container. +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: none + diff_mode: + support: none + options: container: type: str @@ -82,8 +93,6 @@ options: type: dict version_added: 2.1.0 -extends_documentation_fragment: - - community.docker.docker.api_documentation notes: - Does not support C(check_mode). author: diff --git a/plugins/modules/docker_container_info.py b/plugins/modules/docker_container_info.py index 9c631110..bfc28156 100644 --- a/plugins/modules/docker_container_info.py +++ b/plugins/modules/docker_container_info.py @@ -19,6 +19,11 @@ description: - Essentially returns the output of C(docker inspect ), similar to what M(community.docker.docker_container) returns for a non-absent container. +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + - community.docker.attributes.info_module options: name: @@ -27,9 +32,6 @@ options: - When identifying an existing container name may be a name or a long or short container ID. type: str required: true -extends_documentation_fragment: -- community.docker.docker.api_documentation - author: - "Felix Fontein (@felixfontein)" diff --git a/plugins/modules/docker_host_info.py b/plugins/modules/docker_host_info.py index e69d1fb6..0d452ba8 100644 --- a/plugins/modules/docker_host_info.py +++ b/plugins/modules/docker_host_info.py @@ -23,6 +23,20 @@ description: - If the docker daemon cannot be contacted or does not meet the API version requirements, the module will fail. +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + details: + - This action does not modify state. + diff_mode: + support: N/A + details: + - This action does not modify state. options: containers: @@ -94,9 +108,6 @@ options: for each type of the objects. type: bool default: false -extends_documentation_fragment: -- community.docker.docker.api_documentation - author: - Piotr Wojciechowski (@WojciechowskiPiotr) diff --git a/plugins/modules/docker_image.py b/plugins/modules/docker_image.py index a6f10dbc..24713c1d 100644 --- a/plugins/modules/docker_image.py +++ b/plugins/modules/docker_image.py @@ -14,7 +14,6 @@ module: docker_image short_description: Manage docker images - description: - Build, load or pull an image, making the image available for creating containers. Also supports tagging an image, pushing an image, and archiving an image to a C(.tar) file. @@ -22,6 +21,19 @@ description: notes: - Building images is done using Docker daemon's API. It is not possible to use BuildKit / buildx this way. +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: partial + details: + - When trying to pull an image, the module assumes this is always changed in check mode. + diff_mode: + support: none + options: source: description: @@ -209,10 +221,6 @@ options: type: str default: latest -extends_documentation_fragment: - - community.docker.docker.api_documentation - - requirements: - "Docker API >= 1.25" diff --git a/plugins/modules/docker_image_info.py b/plugins/modules/docker_image_info.py index 1b3aafbf..e4f480b1 100644 --- a/plugins/modules/docker_image_info.py +++ b/plugins/modules/docker_image_info.py @@ -14,17 +14,22 @@ module: docker_image_info short_description: Inspect docker images - description: - - Provide one or more image names, and the module will inspect each, returning an array of inspection results. - - If an image does not exist locally, it will not appear in the results. If you want to check whether an image exists - locally, you can call the module with the image name, then check whether the result list is empty (image does not - exist) or has one element (the image exists locally). - - The module will not attempt to pull images from registries. Use M(community.docker.docker_image) with I(source) set to C(pull) - to ensure an image is pulled. + - Provide one or more image names, and the module will inspect each, returning an array of inspection results. + - If an image does not exist locally, it will not appear in the results. If you want to check whether an image exists + locally, you can call the module with the image name, then check whether the result list is empty (image does not + exist) or has one element (the image exists locally). + - The module will not attempt to pull images from registries. Use M(community.docker.docker_image) with I(source) set to C(pull) + to ensure an image is pulled. notes: - - This module was called C(docker_image_facts) before Ansible 2.8. The usage did not change. + - This module was called C(docker_image_facts) before Ansible 2.8. The usage did not change. + +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + - community.docker.attributes.info_module options: name: @@ -36,10 +41,6 @@ options: type: list elements: str -extends_documentation_fragment: -- community.docker.docker.api_documentation - - requirements: - "Docker API >= 1.25" diff --git a/plugins/modules/docker_image_load.py b/plugins/modules/docker_image_load.py index 2988c1ca..880ae4e4 100644 --- a/plugins/modules/docker_image_load.py +++ b/plugins/modules/docker_image_load.py @@ -21,6 +21,17 @@ description: - Load one or multiple Docker images from a C(.tar) archive, and return information on the loaded image(s). +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: none + diff_mode: + support: none + options: path: description: @@ -28,9 +39,6 @@ options: type: path required: true -extends_documentation_fragment: - - community.docker.docker.api_documentation - notes: - Does not support C(check_mode). diff --git a/plugins/modules/docker_login.py b/plugins/modules/docker_login.py index 009761e4..360dd578 100644 --- a/plugins/modules/docker_login.py +++ b/plugins/modules/docker_login.py @@ -16,12 +16,24 @@ DOCUMENTATION = ''' module: docker_login short_description: Log into a Docker registry. description: - - Provides functionality similar to the C(docker login) command. - - Authenticate with a docker registry and add the credentials to your local Docker config file respectively the - credentials store associated to the registry. Adding the credentials to the config files resp. the credential - store allows future connections to the registry using tools such as Ansible's Docker modules, the Docker CLI - and Docker SDK for Python without needing to provide credentials. - - Running in check mode will perform the authentication without updating the config file. + - Provides functionality similar to the C(docker login) command. + - Authenticate with a docker registry and add the credentials to your local Docker config file respectively the + credentials store associated to the registry. Adding the credentials to the config files resp. the credential + store allows future connections to the registry using tools such as Ansible's Docker modules, the Docker CLI + and Docker SDK for Python without needing to provide credentials. + - Running in check mode will perform the authentication without updating the config file. + +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + diff_mode: + support: none + options: registry_url: description: @@ -65,9 +77,6 @@ options: default: 'present' choices: ['present', 'absent'] -extends_documentation_fragment: - - community.docker.docker.api_documentation - requirements: - "Docker API >= 1.25" author: diff --git a/plugins/modules/docker_network.py b/plugins/modules/docker_network.py index e2d25e9e..db932363 100644 --- a/plugins/modules/docker_network.py +++ b/plugins/modules/docker_network.py @@ -14,6 +14,18 @@ short_description: Manage Docker networks description: - Create/remove Docker networks and connect containers to them. - Performs largely the same function as the C(docker network) CLI subcommand. + +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + diff_mode: + support: full + options: name: description: @@ -149,10 +161,6 @@ options: - If enabled, and the network is in the global scope, non-service containers on worker nodes will be able to connect to the network. type: bool -extends_documentation_fragment: -- community.docker.docker.api_documentation - - notes: - When network options are changed, the module disconnects all containers from the network, deletes the network, and re-creates the network. It does not try to reconnect containers, except the ones listed in (I(connected), and even for these, it does not consider specific diff --git a/plugins/modules/docker_network_info.py b/plugins/modules/docker_network_info.py index fc88dd17..9818baad 100644 --- a/plugins/modules/docker_network_info.py +++ b/plugins/modules/docker_network_info.py @@ -19,6 +19,11 @@ description: - Essentially returns the output of C(docker network inspect ), similar to what M(community.docker.docker_network) returns for a non-absent network. +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + - community.docker.attributes.info_module options: name: @@ -27,9 +32,6 @@ options: - When identifying an existing network name may be a name or a long or short network ID. type: str required: true -extends_documentation_fragment: -- community.docker.docker.api_documentation - author: - "Dave Bendit (@DBendit)" diff --git a/plugins/modules/docker_node.py b/plugins/modules/docker_node.py index a1142f75..d097b07f 100644 --- a/plugins/modules/docker_node.py +++ b/plugins/modules/docker_node.py @@ -15,6 +15,19 @@ short_description: Manage Docker Swarm node description: - Manages the Docker nodes via Swarm Manager. - This module allows to change the node's role, its availability, and to modify, add or remove node labels. + +extends_documentation_fragment: + - community.docker.docker + - community.docker.docker.docker_py_1_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + diff_mode: + support: none + options: hostname: description: @@ -69,9 +82,6 @@ options: - manager - worker type: str -extends_documentation_fragment: -- community.docker.docker -- community.docker.docker.docker_py_1_documentation requirements: - "L(Docker SDK for Python,https://docker-py.readthedocs.io/en/stable/) >= 2.4.0" diff --git a/plugins/modules/docker_node_info.py b/plugins/modules/docker_node_info.py index 3b2258c6..d943db31 100644 --- a/plugins/modules/docker_node_info.py +++ b/plugins/modules/docker_node_info.py @@ -19,6 +19,12 @@ description: - Essentially returns the output of C(docker node inspect ). - Must be executed on a host running as Swarm Manager, otherwise the module will fail. +extends_documentation_fragment: + - community.docker.docker + - community.docker.docker.docker_py_1_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + - community.docker.attributes.info_module options: name: @@ -37,10 +43,6 @@ options: - If C(false) then query depends on I(name) presence and value. type: bool default: false -extends_documentation_fragment: -- community.docker.docker -- community.docker.docker.docker_py_1_documentation - author: - Piotr Wojciechowski (@WojciechowskiPiotr) diff --git a/plugins/modules/docker_plugin.py b/plugins/modules/docker_plugin.py index f0bfd038..a3d2ccae 100644 --- a/plugins/modules/docker_plugin.py +++ b/plugins/modules/docker_plugin.py @@ -17,6 +17,18 @@ version_added: 1.3.0 description: - This module allows to install, delete, enable and disable Docker plugins. - Performs largely the same function as the C(docker plugin) CLI subcommand. + +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + diff_mode: + support: full + options: plugin_name: description: @@ -62,9 +74,6 @@ options: type: int default: 0 -extends_documentation_fragment: - - community.docker.docker.api_documentation - author: - Sakar Mehra (@sakar97) - Vladimir Porshkevich (@porshkevich) diff --git a/plugins/modules/docker_prune.py b/plugins/modules/docker_prune.py index 407d1c64..2d7b82ec 100644 --- a/plugins/modules/docker_prune.py +++ b/plugins/modules/docker_prune.py @@ -18,6 +18,16 @@ description: - Allows to run C(docker container prune), C(docker image prune), C(docker network prune) and C(docker volume prune) via the Docker API. +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: none + diff_mode: + support: none options: containers: @@ -72,10 +82,6 @@ options: type: bool default: false -extends_documentation_fragment: - - community.docker.docker.api_documentation - - author: - "Felix Fontein (@felixfontein)" diff --git a/plugins/modules/docker_secret.py b/plugins/modules/docker_secret.py index 8b258872..546756a4 100644 --- a/plugins/modules/docker_secret.py +++ b/plugins/modules/docker_secret.py @@ -14,13 +14,25 @@ module: docker_secret short_description: Manage docker secrets. - description: - - Create and remove Docker secrets in a Swarm environment. Similar to C(docker secret create) and C(docker secret rm). - - Adds to the metadata of new secrets C(ansible_key), an encrypted hash representation of the data, which is then used - in future runs to test if a secret has changed. If C(ansible_key) is not present, then a secret will not be updated - unless the I(force) option is set. - - Updates to secrets are performed by removing the secret and creating it again. + - Create and remove Docker secrets in a Swarm environment. Similar to C(docker secret create) and C(docker secret rm). + - Adds to the metadata of new secrets C(ansible_key), an encrypted hash representation of the data, which is then used + in future runs to test if a secret has changed. If C(ansible_key) is not present, then a secret will not be updated + unless the I(force) option is set. + - Updates to secrets are performed by removing the secret and creating it again. + +extends_documentation_fragment: + - community.docker.docker + - community.docker.docker.docker_py_2_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + diff_mode: + support: none + options: data: description: @@ -81,11 +93,6 @@ options: - absent - present -extends_documentation_fragment: -- community.docker.docker -- community.docker.docker.docker_py_2_documentation - - requirements: - "L(Docker SDK for Python,https://docker-py.readthedocs.io/en/stable/) >= 2.1.0" - "Docker API >= 1.25" diff --git a/plugins/modules/docker_stack.py b/plugins/modules/docker_stack.py index eed75f75..98f4c3ad 100644 --- a/plugins/modules/docker_stack.py +++ b/plugins/modules/docker_stack.py @@ -17,6 +17,13 @@ short_description: docker stack module description: - Manage docker stacks using the C(docker stack) command on the target node (see examples). +extends_documentation_fragment: + - community.docker.attributes +attributes: + check_mode: + support: none + diff_mode: + support: none options: name: description: diff --git a/plugins/modules/docker_stack_info.py b/plugins/modules/docker_stack_info.py index 547fb4d9..bf3bfbdb 100644 --- a/plugins/modules/docker_stack_info.py +++ b/plugins/modules/docker_stack_info.py @@ -17,6 +17,9 @@ short_description: Return information on a docker stack description: - Retrieve information on docker stacks using the C(docker stack) command on the target node (see examples). +extends_documentation_fragment: + - community.docker.attributes + - community.docker.attributes.info_module ''' RETURN = ''' diff --git a/plugins/modules/docker_stack_task_info.py b/plugins/modules/docker_stack_task_info.py index a463d439..e3693bc5 100644 --- a/plugins/modules/docker_stack_task_info.py +++ b/plugins/modules/docker_stack_task_info.py @@ -17,6 +17,9 @@ short_description: Return information of the tasks on a docker stack description: - Retrieve information on docker stacks tasks using the C(docker stack) command on the target node (see examples). +extends_documentation_fragment: + - community.docker.attributes + - community.docker.attributes.info_module options: name: description: diff --git a/plugins/modules/docker_swarm.py b/plugins/modules/docker_swarm.py index f3253bae..31306ecf 100644 --- a/plugins/modules/docker_swarm.py +++ b/plugins/modules/docker_swarm.py @@ -14,6 +14,19 @@ short_description: Manage Swarm cluster description: - Create a new Swarm cluster. - Add/Remove nodes or managers to an existing cluster. + +extends_documentation_fragment: + - community.docker.docker + - community.docker.docker.docker_py_1_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + diff_mode: + support: full + options: advertise_addr: description: @@ -193,9 +206,6 @@ options: considered for idempotency checking. type: int version_added: 3.1.0 -extends_documentation_fragment: -- community.docker.docker -- community.docker.docker.docker_py_1_documentation requirements: - "L(Docker SDK for Python,https://docker-py.readthedocs.io/en/stable/) >= 1.10.0" diff --git a/plugins/modules/docker_swarm_info.py b/plugins/modules/docker_swarm_info.py index 55e003e1..97025a65 100644 --- a/plugins/modules/docker_swarm_info.py +++ b/plugins/modules/docker_swarm_info.py @@ -23,9 +23,15 @@ description: the docker daemon can be communicated with, whether it is in Swarm mode, and whether it is a Swarm Manager node. - author: - - Piotr Wojciechowski (@WojciechowskiPiotr) + - Piotr Wojciechowski (@WojciechowskiPiotr) + +extends_documentation_fragment: + - community.docker.docker + - community.docker.docker.docker_py_1_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + - community.docker.attributes.info_module options: nodes: @@ -78,10 +84,6 @@ options: for each type of the objects. type: bool default: false -extends_documentation_fragment: -- community.docker.docker -- community.docker.docker.docker_py_1_documentation - requirements: - "L(Docker SDK for Python,https://docker-py.readthedocs.io/en/stable/) >= 1.10.0" diff --git a/plugins/modules/docker_swarm_service.py b/plugins/modules/docker_swarm_service.py index bd773ea6..bb12fd38 100644 --- a/plugins/modules/docker_swarm_service.py +++ b/plugins/modules/docker_swarm_service.py @@ -19,6 +19,19 @@ short_description: docker swarm service description: - Manages docker services via a swarm manager node. - This modules does not support updating services in a stack. + +extends_documentation_fragment: + - community.docker.docker + - community.docker.docker.docker_py_2_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + diff_mode: + support: full + options: args: description: @@ -629,9 +642,6 @@ options: type: list elements: str version_added: 2.2.0 -extends_documentation_fragment: -- community.docker.docker -- community.docker.docker.docker_py_2_documentation requirements: - "L(Docker SDK for Python,https://docker-py.readthedocs.io/en/stable/) >= 2.0.2" diff --git a/plugins/modules/docker_swarm_service_info.py b/plugins/modules/docker_swarm_service_info.py index cd94cbf8..ebe8a8e1 100644 --- a/plugins/modules/docker_swarm_service_info.py +++ b/plugins/modules/docker_swarm_service_info.py @@ -19,6 +19,12 @@ description: - Essentially returns the output of C(docker service inspect ). - Must be executed on a host running as Swarm Manager, otherwise the module will fail. +extends_documentation_fragment: + - community.docker.docker + - community.docker.docker.docker_py_1_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + - community.docker.attributes.info_module options: name: @@ -26,10 +32,6 @@ options: - The name of the service to inspect. type: str required: true -extends_documentation_fragment: -- community.docker.docker -- community.docker.docker.docker_py_1_documentation - author: - Hannes Ljungberg (@hannseman) diff --git a/plugins/modules/docker_volume.py b/plugins/modules/docker_volume.py index 820af261..9a8e50cd 100644 --- a/plugins/modules/docker_volume.py +++ b/plugins/modules/docker_volume.py @@ -15,6 +15,18 @@ short_description: Manage Docker volumes description: - Create/remove Docker volumes. - Performs largely the same function as the C(docker volume) CLI subcommand. + +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + +attributes: + check_mode: + support: full + diff_mode: + support: full + options: volume_name: description: @@ -69,10 +81,6 @@ options: - absent - present -extends_documentation_fragment: -- community.docker.docker.api_documentation - - author: - Alex Grönholm (@agronholm) diff --git a/plugins/modules/docker_volume_info.py b/plugins/modules/docker_volume_info.py index 0fb919d3..100010ba 100644 --- a/plugins/modules/docker_volume_info.py +++ b/plugins/modules/docker_volume_info.py @@ -14,6 +14,13 @@ module: docker_volume_info short_description: Retrieve facts about Docker volumes description: - Performs largely the same function as the C(docker volume inspect) CLI subcommand. + +extends_documentation_fragment: + - community.docker.docker.api_documentation + - community.docker.attributes + - community.docker.attributes.actiongroup_docker + - community.docker.attributes.info_module + options: name: description: @@ -23,10 +30,6 @@ options: aliases: - volume_name -extends_documentation_fragment: -- community.docker.docker.api_documentation - - author: - Felix Fontein (@felixfontein)