From b29e91f86697132bceb4369d9420dc2856a9d50d Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 10 Aug 2022 21:46:13 +0200 Subject: [PATCH] Normalize booleans in all other plugins and modules. (#440) (#443) (cherry picked from commit be58ccc13fa8ae262b5b6b74752e08ef0587f61f) --- plugins/doc_fragments/docker.py | 10 ++--- plugins/inventory/docker_machine.py | 10 ++--- plugins/inventory/docker_swarm.py | 14 +++--- plugins/modules/docker_compose.py | 38 ++++++++-------- plugins/modules/docker_config.py | 8 ++-- plugins/modules/docker_container_info.py | 2 +- plugins/modules/docker_host_info.py | 46 ++++++++++---------- plugins/modules/docker_image.py | 24 +++++----- plugins/modules/docker_login.py | 4 +- plugins/modules/docker_network.py | 14 +++--- plugins/modules/docker_network_info.py | 2 +- plugins/modules/docker_node.py | 2 +- plugins/modules/docker_node_info.py | 2 +- plugins/modules/docker_prune.py | 32 +++++++------- plugins/modules/docker_secret.py | 8 ++-- plugins/modules/docker_stack.py | 6 +-- plugins/modules/docker_stack_task_info.py | 2 +- plugins/modules/docker_swarm.py | 8 ++-- plugins/modules/docker_swarm_info.py | 36 +++++++-------- plugins/modules/docker_swarm_service.py | 16 +++---- plugins/modules/docker_swarm_service_info.py | 2 +- plugins/modules/docker_volume.py | 2 +- plugins/modules/docker_volume_info.py | 2 +- 23 files changed, 145 insertions(+), 145 deletions(-) diff --git a/plugins/doc_fragments/docker.py b/plugins/doc_fragments/docker.py index 162b3a33..d78a43f4 100644 --- a/plugins/doc_fragments/docker.py +++ b/plugins/doc_fragments/docker.py @@ -77,17 +77,17 @@ options: tls: description: - Secure the connection to the API by using TLS without verifying the authenticity of the Docker host - server. Note that if I(validate_certs) is set to C(yes) as well, it will take precedence. + server. Note that if I(validate_certs) is set to C(true) as well, it will take precedence. - If the value is not specified in the task, the value of environment variable C(DOCKER_TLS) will be used instead. If the environment variable is not set, the default value will be used. type: bool - default: no + default: false use_ssh_client: description: - For SSH transports, use the C(ssh) CLI tool instead of paramiko. - Requires Docker SDK for Python 4.4.0 or newer. type: bool - default: no + default: false version_added: 1.5.0 validate_certs: description: @@ -95,13 +95,13 @@ options: - If the value is not specified in the task, the value of environment variable C(DOCKER_TLS_VERIFY) will be used instead. If the environment variable is not set, the default value will be used. type: bool - default: no + default: false aliases: [ tls_verify ] debug: description: - Debug mode type: bool - default: no + default: false notes: - Connect to the Docker daemon by providing parameters with each task or by defining environment variables. diff --git a/plugins/inventory/docker_machine.py b/plugins/inventory/docker_machine.py index 01a72b67..1833990d 100644 --- a/plugins/inventory/docker_machine.py +++ b/plugins/inventory/docker_machine.py @@ -22,7 +22,7 @@ DOCUMENTATION = ''' options: plugin: description: token that ensures this is a source file for the C(docker_machine) plugin. - required: yes + required: true choices: ['docker_machine', 'community.docker.docker_machine'] daemon_env: description: @@ -45,13 +45,13 @@ DOCUMENTATION = ''' description: - When C(true), hosts which Docker Machine indicates are in a state other than C(running) will be skipped. type: bool - default: yes + default: true verbose_output: description: - When C(true), include all available nodes metadata (for exmaple C(Image), C(Region), C(Size)) as a JSON object named C(docker_machine_node_attributes). type: bool - default: yes + default: true ''' EXAMPLES = ''' @@ -70,13 +70,13 @@ plugin: community.docker.docker_machine # ] # ... # } -strict: no +strict: false keyed_groups: - separator: '' key: docker_machine_node_attributes.DriverName # Example grouping hosts by Digital Machine tag -strict: no +strict: false keyed_groups: - prefix: tag key: 'dm_tags' diff --git a/plugins/inventory/docker_swarm.py b/plugins/inventory/docker_swarm.py index cad41f7a..ce5127ec 100644 --- a/plugins/inventory/docker_swarm.py +++ b/plugins/inventory/docker_swarm.py @@ -41,16 +41,16 @@ DOCUMENTATION = ''' description: Toggle to (not) include all available nodes metadata (for example C(Platform), C(Architecture), C(OS), C(EngineVersion)) type: bool - default: yes + default: true tls: description: Connect using TLS without verifying the authenticity of the Docker host server. type: bool - default: no + default: false validate_certs: description: Toggle if connecting using TLS with or without verifying the authenticity of the Docker host server. type: bool - default: no + default: false aliases: [ tls_verify ] client_key: description: Path to the client's TLS key file. @@ -91,7 +91,7 @@ DOCUMENTATION = ''' - For SSH transports, use the C(ssh) CLI tool instead of paramiko. - Requires Docker SDK for Python 4.4.0 or newer. type: bool - default: no + default: false version_added: 1.5.0 include_host_uri: description: Toggle to return the additional attribute C(ansible_host_uri) which contains the URI of the @@ -99,7 +99,7 @@ DOCUMENTATION = ''' modification as value of option I(docker_host) in Docker Swarm modules when connecting via API. The port always defaults to C(2376). type: bool - default: no + default: false include_host_uri_port: description: Override the detected port number included in I(ansible_host_uri) type: int @@ -117,12 +117,12 @@ docker_host: tcp://my-docker-host:2375 # Example using remote docker with unverified TLS plugin: community.docker.docker_swarm docker_host: tcp://my-docker-host:2376 -tls: yes +tls: true # Example using remote docker with verified TLS and client certificate verification plugin: community.docker.docker_swarm docker_host: tcp://my-docker-host:2376 -validate_certs: yes +validate_certs: true ca_cert: /somewhere/ca.pem client_key: /somewhere/key.pem client_cert: /somewhere/cert.pem diff --git a/plugins/modules/docker_compose.py b/plugins/modules/docker_compose.py index 1ecf9e04..1754a925 100644 --- a/plugins/modules/docker_compose.py +++ b/plugins/modules/docker_compose.py @@ -86,7 +86,7 @@ options: description: - When I(state) is C(present) specify whether or not to include linked services. type: bool - default: yes + default: true definition: description: - Compose file describing one or more services, networks and volumes. @@ -96,7 +96,7 @@ options: description: - Whether or not to check the Docker daemon's hostname against the name provided in the client certificate. type: bool - default: no + default: false recreate: description: - By default containers will be recreated when their configuration differs from the service definition. @@ -116,19 +116,19 @@ options: - Use the I(nocache) option to ignore the image cache when performing the build. - If an existing image is replaced, services using the image will be recreated unless I(recreate) is C(never). type: bool - default: no + default: false pull: description: - Use with I(state) C(present) to always pull images prior to starting the application. - Same as running C(docker-compose pull). - When a new image is pulled, services using the image will be recreated unless I(recreate) is C(never). type: bool - default: no + default: false nocache: description: - Use with the I(build) option to ignore the cache during the image build process. type: bool - default: no + default: false remove_images: description: - Use with I(state) C(absent) to remove all images or only local images. @@ -140,7 +140,7 @@ options: description: - Use with I(state) C(absent) to remove data volumes. type: bool - default: no + default: false stopped: description: - Use with I(state) C(present) to stop all containers defined in the Compose file. @@ -148,18 +148,18 @@ options: - Requires C(docker-compose) version 1.17.0 or greater for full support. For older versions, the services will first be started and then stopped when the service is supposed to be created as stopped. type: bool - default: no + default: false restarted: description: - Use with I(state) C(present) to restart all containers defined in the Compose file. - If I(services) is defined, only the containers listed there will be restarted. type: bool - default: no + default: false remove_orphans: description: - Remove containers for services not defined in the Compose file. type: bool - default: no + default: false timeout: description: - Timeout in seconds for container shutdown when attached or when containers are already running. @@ -189,7 +189,7 @@ EXAMPLES = ''' - name: Run using a project directory hosts: localhost - gather_facts: no + gather_facts: false tasks: - name: Tear down existing services community.docker.docker_compose: @@ -207,7 +207,7 @@ EXAMPLES = ''' - name: Run `docker-compose up` again community.docker.docker_compose: project_src: flask - build: no + build: false register: output - ansible.builtin.debug: @@ -219,8 +219,8 @@ EXAMPLES = ''' - name: Stop all services community.docker.docker_compose: project_src: flask - build: no - stopped: yes + build: false + stopped: true register: output - ansible.builtin.debug: @@ -234,8 +234,8 @@ EXAMPLES = ''' - name: Restart services community.docker.docker_compose: project_src: flask - build: no - restarted: yes + build: false + restarted: true register: output - ansible.builtin.debug: @@ -248,7 +248,7 @@ EXAMPLES = ''' - name: Scale the web service to 2 hosts: localhost - gather_facts: no + gather_facts: false tasks: - community.docker.docker_compose: project_src: flask @@ -261,7 +261,7 @@ EXAMPLES = ''' - name: Run with inline v2 compose hosts: localhost - gather_facts: no + gather_facts: false tasks: - community.docker.docker_compose: project_src: flask @@ -295,7 +295,7 @@ EXAMPLES = ''' - name: Run with inline v1 compose hosts: localhost - gather_facts: no + gather_facts: false tasks: - community.docker.docker_compose: project_src: flask @@ -415,7 +415,7 @@ services: actions: description: Provides the actions to be taken on each service as determined by compose. - returned: when in check mode or I(debug) is C(yes) + returned: when in check mode or I(debug) is C(true) type: complex contains: service_name: diff --git a/plugins/modules/docker_config.py b/plugins/modules/docker_config.py index 71887a54..7038752d 100644 --- a/plugins/modules/docker_config.py +++ b/plugins/modules/docker_config.py @@ -33,7 +33,7 @@ options: - To use binary I(data), it is better to keep it Base64 encoded and let it be decoded by this option. type: bool - default: no + default: false data_src: description: - The file on the target from which to read the config. @@ -50,7 +50,7 @@ options: - Use with state C(present) to always remove and recreate an existing config. - If C(true), an existing config will be replaced, even if it has not been changed. type: bool - default: no + default: false rolling_versions: description: - If set to C(true), configs are created with an increasing version number appended to their name. @@ -70,7 +70,7 @@ options: description: - The name of the config. type: str - required: yes + required: true state: description: - Set to C(present), if the config should exist, and C(absent), if it should not. @@ -162,7 +162,7 @@ EXAMPLES = ''' community.docker.docker_config: name: foo data: Goodnight everyone! - force: yes + force: true state: present - name: Remove config foo diff --git a/plugins/modules/docker_container_info.py b/plugins/modules/docker_container_info.py index 85e5807f..5921f5a0 100644 --- a/plugins/modules/docker_container_info.py +++ b/plugins/modules/docker_container_info.py @@ -25,7 +25,7 @@ options: - The name of the container to inspect. - When identifying an existing container name may be a name or a long or short container ID. type: str - required: yes + required: true extends_documentation_fragment: - community.docker.docker - community.docker.docker.docker_py_1_documentation diff --git a/plugins/modules/docker_host_info.py b/plugins/modules/docker_host_info.py index 570516cd..ad2bd806 100644 --- a/plugins/modules/docker_host_info.py +++ b/plugins/modules/docker_host_info.py @@ -28,7 +28,7 @@ options: description: - Whether to list containers. type: bool - default: no + default: false containers_filters: description: - A dictionary of filter values used for selecting containers to list. @@ -42,7 +42,7 @@ options: description: - Whether to list images. type: bool - default: no + default: false images_filters: description: - A dictionary of filter values used for selecting images to list. @@ -56,7 +56,7 @@ options: description: - Whether to list networks. type: bool - default: no + default: false networks_filters: description: - A dictionary of filter values used for selecting networks to list. @@ -69,7 +69,7 @@ options: description: - Whether to list volumes. type: bool - default: no + default: false volumes_filters: description: - A dictionary of filter values used for selecting volumes to list. @@ -83,16 +83,16 @@ options: - Summary information on used disk space by all Docker layers. - The output is a sum of images, volumes, containers and build cache. type: bool - default: no + default: false verbose_output: description: - - When set to C(yes) and I(networks), I(volumes), I(images), I(containers) or I(disk_usage) is set to C(yes) + - When set to C(true) and I(networks), I(volumes), I(images), I(containers) or I(disk_usage) is set to C(true) 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(_info) module for each type of the objects. type: bool - default: no + default: false extends_documentation_fragment: - community.docker.docker - community.docker.docker.docker_py_1_documentation @@ -113,30 +113,30 @@ EXAMPLES = ''' - name: Get info on docker host and list images community.docker.docker_host_info: - images: yes + images: true register: result - name: Get info on docker host and list images matching the filter community.docker.docker_host_info: - images: yes + images: true images_filters: label: "mylabel" register: result - name: Get info on docker host and verbose list images community.docker.docker_host_info: - images: yes - verbose_output: yes + images: true + verbose_output: true register: result - name: Get info on docker host and used disk space community.docker.docker_host_info: - disk_usage: yes + disk_usage: true register: result - name: Get info on docker host and list containers matching the filter community.docker.docker_host_info: - containers: yes + containers: true containers_filters: label: - key1=value1 @@ -163,40 +163,40 @@ host_info: volumes: description: - List of dict objects containing the basic information about each volume. - Keys matches the C(docker volume ls) output unless I(verbose_output=yes). + Keys matches the C(docker volume ls) output unless I(verbose_output=true). See description for I(verbose_output). - returned: When I(volumes) is C(yes) + returned: When I(volumes) is C(true) type: list elements: dict networks: description: - List of dict objects containing the basic information about each network. - Keys matches the C(docker network ls) output unless I(verbose_output=yes). + Keys matches the C(docker network ls) output unless I(verbose_output=true). See description for I(verbose_output). - returned: When I(networks) is C(yes) + returned: When I(networks) is C(true) type: list elements: dict containers: description: - List of dict objects containing the basic information about each container. - Keys matches the C(docker container ls) output unless I(verbose_output=yes). + Keys matches the C(docker container ls) output unless I(verbose_output=true). See description for I(verbose_output). - returned: When I(containers) is C(yes) + returned: When I(containers) is C(true) type: list elements: dict images: description: - List of dict objects containing the basic information about each image. - Keys matches the C(docker image ls) output unless I(verbose_output=yes). + Keys matches the C(docker image ls) output unless I(verbose_output=true). See description for I(verbose_output). - returned: When I(images) is C(yes) + returned: When I(images) is C(true) type: list elements: dict disk_usage: description: - Information on summary disk usage by images, containers and volumes on docker host - unless I(verbose_output=yes). See description for I(verbose_output). - returned: When I(disk_usage) is C(yes) + unless I(verbose_output=true). See description for I(verbose_output). + returned: When I(disk_usage) is C(true) type: dict ''' diff --git a/plugins/modules/docker_image.py b/plugins/modules/docker_image.py index 4b642dd4..9f681c34 100644 --- a/plugins/modules/docker_image.py +++ b/plugins/modules/docker_image.py @@ -60,17 +60,17 @@ options: - Use with state 'present' to build an image. Will be the path to a directory containing the context and Dockerfile for building an image. type: path - required: yes + required: true pull: description: - When building an image downloads any updates to the FROM image in Dockerfile. type: bool - default: no + default: false rm: description: - Remove intermediate containers after build. type: bool - default: yes + default: true network: description: - The network to use for C(RUN) build instructions. @@ -79,7 +79,7 @@ options: description: - Do not use cache when building an image. type: bool - default: no + default: false etc_hosts: description: - Extra hosts to add to C(/etc/hosts) in building containers, as a mapping of hostname to IP address. @@ -115,7 +115,7 @@ options: type: str use_config_proxy: description: - - If set to C(yes) and a proxy configuration is specified in the docker client configuration + - If set to C(true) and a proxy configuration is specified in the docker client configuration (by default C($HOME/.docker/config.json)), the corresponding environment variables will be set in the container being built. - Needs Docker SDK for Python >= 3.7.0. @@ -162,7 +162,7 @@ options: - Note that image IDs (hashes) are only supported for I(state=absent), for I(state=present) with I(source=load), and for I(state=present) with I(source=local). type: str - required: yes + required: true pull: description: - "Specifies options used for pulling images." @@ -179,7 +179,7 @@ options: description: - Push the image to the registry. Specify the registry as part of the I(name) or I(repository) parameter. type: bool - default: no + default: false repository: description: - Use with state C(present) to tag the image. @@ -237,7 +237,7 @@ EXAMPLES = ''' community.docker.docker_image: name: pacur/centos-7:56 repository: dcoppenhagan/myimage:7.56 - push: yes + push: true source: local - name: Tag and push to local registry @@ -247,7 +247,7 @@ EXAMPLES = ''' # Will be pushed to localhost:5000/centos:7 repository: localhost:5000/centos tag: 7 - push: yes + push: true source: local - name: Add tag latest to image @@ -255,7 +255,7 @@ EXAMPLES = ''' name: myimage:7.1.2 repository: myimage:latest # As 'latest' usually already is present, we need to enable overwriting of existing tags: - force_tag: yes + force_tag: true source: local - name: Remove image @@ -270,7 +270,7 @@ EXAMPLES = ''' path: ./sinatra name: registry.ansible.com/chouseknecht/sinatra tag: v1 - push: yes + push: true source: build - name: Archive image @@ -284,7 +284,7 @@ EXAMPLES = ''' community.docker.docker_image: name: localhost:5000/myimages/sinatra tag: v1 - push: yes + push: true load_path: my_sinatra.tar source: load diff --git a/plugins/modules/docker_login.py b/plugins/modules/docker_login.py index e79c2871..c59524e9 100644 --- a/plugins/modules/docker_login.py +++ b/plugins/modules/docker_login.py @@ -44,7 +44,7 @@ options: description: - Refresh existing authentication found in the configuration file. type: bool - default: no + default: false aliases: - reauth config_path: @@ -90,7 +90,7 @@ EXAMPLES = ''' registry_url: your.private.registry.io username: yourself password: secrets3 - reauthorize: yes + reauthorize: true - name: Log into DockerHub using a custom config file community.docker.docker_login: diff --git a/plugins/modules/docker_network.py b/plugins/modules/docker_network.py index b997e869..086a4aeb 100644 --- a/plugins/modules/docker_network.py +++ b/plugins/modules/docker_network.py @@ -18,7 +18,7 @@ options: description: - Name of the network to operate on. type: str - required: yes + required: true aliases: - network_name @@ -53,14 +53,14 @@ options: - This option is required if you have changed the IPAM or driver options and want an existing network to be updated to use the new options. type: bool - default: no + default: false appends: description: - By default the connected list is canonical, meaning containers not on the list are removed from the network. - Use I(appends) to leave existing containers connected. type: bool - default: no + default: false aliases: - incremental @@ -192,7 +192,7 @@ EXAMPLES = ''' name: network_one connected: - container_a - appends: yes + appends: true - name: Create a network with driver options community.docker.docker_network: @@ -221,14 +221,14 @@ EXAMPLES = ''' - name: Create a network with IPv6 IPAM config community.docker.docker_network: name: network_ipv6_one - enable_ipv6: yes + enable_ipv6: true ipam_config: - subnet: fdd1:ac8c:0557:7ce1::/64 - name: Create a network with IPv6 and custom IPv4 IPAM config community.docker.docker_network: name: network_ipv6_two - enable_ipv6: yes + enable_ipv6: true ipam_config: - subnet: 172.24.27.0/24 - subnet: fdd1:ac8c:0557:7ce2::/64 @@ -237,7 +237,7 @@ EXAMPLES = ''' community.docker.docker_network: name: network_one state: absent - force: yes + force: true ''' RETURN = ''' diff --git a/plugins/modules/docker_network_info.py b/plugins/modules/docker_network_info.py index 2ec16284..35872337 100644 --- a/plugins/modules/docker_network_info.py +++ b/plugins/modules/docker_network_info.py @@ -25,7 +25,7 @@ options: - The name of the network to inspect. - When identifying an existing network name may be a name or a long or short network ID. type: str - required: yes + required: true extends_documentation_fragment: - community.docker.docker - community.docker.docker.docker_py_1_documentation diff --git a/plugins/modules/docker_node.py b/plugins/modules/docker_node.py index f97fe9df..aa0e2d4b 100644 --- a/plugins/modules/docker_node.py +++ b/plugins/modules/docker_node.py @@ -21,7 +21,7 @@ options: - If more than one node is registered using the same hostname the ID must be used, otherwise module will fail. type: str - required: yes + required: true labels: description: - User-defined key/value metadata that will be assigned as node attribute. diff --git a/plugins/modules/docker_node_info.py b/plugins/modules/docker_node_info.py index fdce4a53..511016fc 100644 --- a/plugins/modules/docker_node_info.py +++ b/plugins/modules/docker_node_info.py @@ -35,7 +35,7 @@ options: - If C(true) then I(name) is ignored. - If C(false) then query depends on I(name) presence and value. type: bool - default: no + default: false extends_documentation_fragment: - community.docker.docker - community.docker.docker.docker_py_1_documentation diff --git a/plugins/modules/docker_prune.py b/plugins/modules/docker_prune.py index 71b88637..9f77548e 100644 --- a/plugins/modules/docker_prune.py +++ b/plugins/modules/docker_prune.py @@ -23,7 +23,7 @@ options: description: - Whether to prune containers. type: bool - default: no + default: false containers_filters: description: - A dictionary of filter values used for selecting containers to delete. @@ -35,7 +35,7 @@ options: description: - Whether to prune images. type: bool - default: no + default: false images_filters: description: - A dictionary of filter values used for selecting images to delete. @@ -47,7 +47,7 @@ options: description: - Whether to prune networks. type: bool - default: no + default: false networks_filters: description: - A dictionary of filter values used for selecting networks to delete. @@ -58,7 +58,7 @@ options: description: - Whether to prune volumes. type: bool - default: no + default: false volumes_filters: description: - A dictionary of filter values used for selecting volumes to delete. @@ -70,7 +70,7 @@ options: - Whether to prune the builder cache. - Requires version 3.3.0 of the Docker SDK for Python or newer. type: bool - default: no + default: false extends_documentation_fragment: - community.docker.docker @@ -88,28 +88,28 @@ requirements: EXAMPLES = ''' - name: Prune containers older than 24h community.docker.docker_prune: - containers: yes + containers: true containers_filters: # only consider containers created more than 24 hours ago until: 24h - name: Prune everything community.docker.docker_prune: - containers: yes - images: yes - networks: yes - volumes: yes - builder_cache: yes + containers: true + images: true + networks: true + volumes: true + builder_cache: true - name: Prune everything (including non-dangling images) community.docker.docker_prune: - containers: yes - images: yes + containers: true + images: true images_filters: dangling: false - networks: yes - volumes: yes - builder_cache: yes + networks: true + volumes: true + builder_cache: true ''' RETURN = ''' diff --git a/plugins/modules/docker_secret.py b/plugins/modules/docker_secret.py index 204af144..c6683669 100644 --- a/plugins/modules/docker_secret.py +++ b/plugins/modules/docker_secret.py @@ -33,7 +33,7 @@ options: - To use binary I(data), it is better to keep it Base64 encoded and let it be decoded by this option. type: bool - default: no + default: false data_src: description: - The file on the target from which to read the secret. @@ -50,7 +50,7 @@ options: - Use with state C(present) to always remove and recreate an existing secret. - If C(true), an existing secret will be replaced, even if it has not changed. type: bool - default: no + default: false rolling_versions: description: - If set to C(true), secrets are created with an increasing version number appended to their name. @@ -70,7 +70,7 @@ options: description: - The name of the secret. type: str - required: yes + required: true state: description: - Set to C(present), if the secret should exist, and C(absent), if it should not. @@ -154,7 +154,7 @@ EXAMPLES = ''' community.docker.docker_secret: name: foo data: Goodnight everyone! - force: yes + force: true state: present - name: Remove secret foo diff --git a/plugins/modules/docker_stack.py b/plugins/modules/docker_stack.py index 7a900dd7..c9fc543c 100644 --- a/plugins/modules/docker_stack.py +++ b/plugins/modules/docker_stack.py @@ -21,7 +21,7 @@ options: description: - Stack name type: str - required: yes + required: true state: description: - Service state. @@ -44,13 +44,13 @@ options: This will have docker remove the services not present in the current stack definition. type: bool - default: no + default: false with_registry_auth: description: - If true will add the C(--with-registry-auth) option to the C(docker stack deploy) command. This will have docker send registry authentication details to Swarm agents. type: bool - default: no + default: false resolve_image: description: - If set will add the C(--resolve-image) option to the C(docker stack deploy) command. diff --git a/plugins/modules/docker_stack_task_info.py b/plugins/modules/docker_stack_task_info.py index 19073c18..68f69ea2 100644 --- a/plugins/modules/docker_stack_task_info.py +++ b/plugins/modules/docker_stack_task_info.py @@ -21,7 +21,7 @@ options: description: - Stack name. type: str - required: yes + required: true ''' RETURN = ''' diff --git a/plugins/modules/docker_swarm.py b/plugins/modules/docker_swarm.py index a78f533e..d90d4865 100644 --- a/plugins/modules/docker_swarm.py +++ b/plugins/modules/docker_swarm.py @@ -59,7 +59,7 @@ options: - Use with state C(present) to force creating a new Swarm, even if already part of one. - Use with state C(absent) to Leave the swarm even if this node is a manager. type: bool - default: no + default: false state: description: - Set to C(present), to create/update a new cluster. @@ -164,17 +164,17 @@ options: autolock_managers: description: - If set, generate a key and use it to lock data stored on the managers. - - Docker default value is C(no). + - Docker default value is C(false). - M(community.docker.docker_swarm_info) can be used to retrieve the unlock key. type: bool rotate_worker_token: description: Rotate the worker join token. type: bool - default: no + default: false rotate_manager_token: description: Rotate the manager join token. type: bool - default: no + default: false data_path_addr: description: - Address or interface to use for data path traffic. diff --git a/plugins/modules/docker_swarm_info.py b/plugins/modules/docker_swarm_info.py index 3beeb14d..76f66558 100644 --- a/plugins/modules/docker_swarm_info.py +++ b/plugins/modules/docker_swarm_info.py @@ -31,7 +31,7 @@ options: description: - Whether to list swarm nodes. type: bool - default: no + default: false nodes_filters: description: - A dictionary of filter values used for selecting nodes to list. @@ -43,7 +43,7 @@ options: description: - Whether to list swarm services. type: bool - default: no + default: false services_filters: description: - A dictionary of filter values used for selecting services to list. @@ -55,7 +55,7 @@ options: description: - Whether to list containers. type: bool - default: no + default: false tasks_filters: description: - A dictionary of filter values used for selecting tasks to list. @@ -67,16 +67,16 @@ options: description: - Whether to retrieve the swarm unlock key. type: bool - default: no + default: false verbose_output: description: - - When set to C(yes) and I(nodes), I(services) or I(tasks) is set to C(yes), then the module output will + - When set to C(true) and I(nodes), I(services) or I(tasks) is set to C(true), then the module 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(_info) module for each type of the objects. type: bool - default: no + default: false extends_documentation_fragment: - community.docker.docker - community.docker.docker.docker_py_1_documentation @@ -90,7 +90,7 @@ requirements: EXAMPLES = ''' - name: Get info on Docker Swarm community.docker.docker_swarm_info: - ignore_errors: yes + ignore_errors: true register: result - name: Inform about basic flags @@ -104,18 +104,18 @@ EXAMPLES = ''' - name: Get info on Docker Swarm and list of registered nodes community.docker.docker_swarm_info: - nodes: yes + nodes: true register: result - name: Get info on Docker Swarm and extended list of registered nodes community.docker.docker_swarm_info: - nodes: yes - verbose_output: yes + nodes: true + verbose_output: true register: result - name: Get info on Docker Swarm and filtered list of registered nodes community.docker.docker_swarm_info: - nodes: yes + nodes: true nodes_filters: name: mynode register: result @@ -125,7 +125,7 @@ EXAMPLES = ''' - name: Get the swarm unlock key community.docker.docker_swarm_info: - unlock_key: yes + unlock_key: true register: result - ansible.builtin.debug: @@ -167,25 +167,25 @@ swarm_unlock_key: nodes: description: - List of dict objects containing the basic information about each volume. - Keys matches the C(docker node ls) output unless I(verbose_output=yes). + Keys matches the C(docker node ls) output unless I(verbose_output=true). See description for I(verbose_output). - returned: When I(nodes) is C(yes) + returned: When I(nodes) is C(true) type: list elements: dict services: description: - List of dict objects containing the basic information about each volume. - Keys matches the C(docker service ls) output unless I(verbose_output=yes). + Keys matches the C(docker service ls) output unless I(verbose_output=true). See description for I(verbose_output). - returned: When I(services) is C(yes) + returned: When I(services) is C(true) type: list elements: dict tasks: description: - List of dict objects containing the basic information about each volume. - Keys matches the C(docker service ps) output unless I(verbose_output=yes). + Keys matches the C(docker service ps) output unless I(verbose_output=true). See description for I(verbose_output). - returned: When I(tasks) is C(yes) + returned: When I(tasks) is C(true) type: list elements: dict diff --git a/plugins/modules/docker_swarm_service.py b/plugins/modules/docker_swarm_service.py index 064162a1..55f911fb 100644 --- a/plugins/modules/docker_swarm_service.py +++ b/plugins/modules/docker_swarm_service.py @@ -46,7 +46,7 @@ options: description: - Config's name as defined at its creation. type: str - required: yes + required: true filename: description: - Name of the file containing the config. Defaults to the I(config_name) if not specified. @@ -121,7 +121,7 @@ options: - Corresponds to the C(--force) option of C(docker service update). - Requires API version >= 1.25. type: bool - default: no + default: false groups: description: - List of additional group names and/or IDs that the container process will run as. @@ -249,7 +249,7 @@ options: description: - Container path. type: str - required: yes + required: true type: description: - The mount type. @@ -317,7 +317,7 @@ options: - Service name. - Corresponds to the C(--name) option of C(docker service create). type: str - required: yes + required: true networks: description: - List of the service networks names or dictionaries. @@ -365,12 +365,12 @@ options: description: - The port to make externally available. type: int - required: no + required: false target_port: description: - The port inside the container to expose. type: int - required: yes + required: true protocol: description: - What protocol to use. @@ -424,7 +424,7 @@ options: - If the current image digest should be resolved from registry and updated if changed. - Requires API version >= 1.30. type: bool - default: no + default: false restart_config: description: - Configures if and how to restart containers when they exit. @@ -522,7 +522,7 @@ options: description: - Secret's name as defined at its creation. type: str - required: yes + required: true filename: description: - Name of the file containing the secret. Defaults to the I(secret_name) if not specified. diff --git a/plugins/modules/docker_swarm_service_info.py b/plugins/modules/docker_swarm_service_info.py index 2c5e3e48..5864c82f 100644 --- a/plugins/modules/docker_swarm_service_info.py +++ b/plugins/modules/docker_swarm_service_info.py @@ -24,7 +24,7 @@ options: description: - The name of the service to inspect. type: str - required: yes + required: true extends_documentation_fragment: - community.docker.docker - community.docker.docker.docker_py_1_documentation diff --git a/plugins/modules/docker_volume.py b/plugins/modules/docker_volume.py index 7e9c8bbe..ba99a5c8 100644 --- a/plugins/modules/docker_volume.py +++ b/plugins/modules/docker_volume.py @@ -19,7 +19,7 @@ options: description: - Name of the volume to operate on. type: str - required: yes + required: true aliases: - name diff --git a/plugins/modules/docker_volume_info.py b/plugins/modules/docker_volume_info.py index e3c899bf..eaf97311 100644 --- a/plugins/modules/docker_volume_info.py +++ b/plugins/modules/docker_volume_info.py @@ -18,7 +18,7 @@ options: description: - Name of the volume to inspect. type: str - required: yes + required: true aliases: - volume_name