From be58ccc13fa8ae262b5b6b74752e08ef0587f61f Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 10 Aug 2022 21:25:10 +0200 Subject: [PATCH] Normalize booleans in all other plugins and modules. (#440) --- plugins/doc_fragments/docker.py | 20 ++++----- 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, 150 insertions(+), 150 deletions(-) diff --git a/plugins/doc_fragments/docker.py b/plugins/doc_fragments/docker.py index 425bb38b..5cea62c3 100644 --- a/plugins/doc_fragments/docker.py +++ b/plugins/doc_fragments/docker.py @@ -76,17 +76,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: @@ -94,13 +94,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. @@ -251,16 +251,16 @@ 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. type: bool - default: no + default: false version_added: 1.5.0 validate_certs: description: @@ -268,13 +268,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 3bae4411..69d94610 100644 --- a/plugins/inventory/docker_machine.py +++ b/plugins/inventory/docker_machine.py @@ -23,7 +23,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: @@ -46,13 +46,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 = ''' @@ -71,13 +71,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 b48a1b0c..9ae2fb9a 100644 --- a/plugins/inventory/docker_swarm.py +++ b/plugins/inventory/docker_swarm.py @@ -42,16 +42,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. @@ -92,7 +92,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 @@ -100,7 +100,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 @@ -118,12 +118,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 f5b8c767..824aef2c 100644 --- a/plugins/modules/docker_compose.py +++ b/plugins/modules/docker_compose.py @@ -87,7 +87,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. @@ -97,7 +97,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. @@ -117,19 +117,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. @@ -141,7 +141,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. @@ -149,18 +149,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. @@ -190,7 +190,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: @@ -208,7 +208,7 @@ EXAMPLES = ''' - name: Run `docker-compose up` again community.docker.docker_compose: project_src: flask - build: no + build: false register: output - ansible.builtin.debug: @@ -220,8 +220,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: @@ -235,8 +235,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: @@ -249,7 +249,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 @@ -262,7 +262,7 @@ EXAMPLES = ''' - name: Run with inline v2 compose hosts: localhost - gather_facts: no + gather_facts: false tasks: - community.docker.docker_compose: project_src: flask @@ -296,7 +296,7 @@ EXAMPLES = ''' - name: Run with inline v1 compose hosts: localhost - gather_facts: no + gather_facts: false tasks: - community.docker.docker_compose: project_src: flask @@ -416,7 +416,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 c5ffbe9f..2657207e 100644 --- a/plugins/modules/docker_config.py +++ b/plugins/modules/docker_config.py @@ -34,7 +34,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. @@ -51,7 +51,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. @@ -71,7 +71,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. @@ -163,7 +163,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 21686a3d..9c631110 100644 --- a/plugins/modules/docker_container_info.py +++ b/plugins/modules/docker_container_info.py @@ -26,7 +26,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.api_documentation diff --git a/plugins/modules/docker_host_info.py b/plugins/modules/docker_host_info.py index f9f94542..e69d1fb6 100644 --- a/plugins/modules/docker_host_info.py +++ b/plugins/modules/docker_host_info.py @@ -29,7 +29,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. @@ -43,7 +43,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. @@ -57,7 +57,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. @@ -70,7 +70,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. @@ -84,16 +84,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.api_documentation @@ -112,30 +112,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 @@ -162,40 +162,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 5eca0d7b..fd048ecc 100644 --- a/plugins/modules/docker_image.py +++ b/plugins/modules/docker_image.py @@ -61,17 +61,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. @@ -80,7 +80,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. type: bool @@ -161,7 +161,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." @@ -178,7 +178,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. @@ -234,7 +234,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 @@ -244,7 +244,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 @@ -252,7 +252,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 @@ -267,7 +267,7 @@ EXAMPLES = ''' path: ./sinatra name: registry.ansible.com/chouseknecht/sinatra tag: v1 - push: yes + push: true source: build - name: Archive image @@ -281,7 +281,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 51114774..009761e4 100644 --- a/plugins/modules/docker_login.py +++ b/plugins/modules/docker_login.py @@ -45,7 +45,7 @@ options: description: - Refresh existing authentication found in the configuration file. type: bool - default: no + default: false aliases: - reauth config_path: @@ -87,7 +87,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 4228eb83..c6a9a828 100644 --- a/plugins/modules/docker_network.py +++ b/plugins/modules/docker_network.py @@ -19,7 +19,7 @@ options: description: - Name of the network to operate on. type: str - required: yes + required: true aliases: - network_name @@ -54,14 +54,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 @@ -191,7 +191,7 @@ EXAMPLES = ''' name: network_one connected: - container_a - appends: yes + appends: true - name: Create a network with driver options community.docker.docker_network: @@ -220,14 +220,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 @@ -236,7 +236,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 f7d7122f..fc88dd17 100644 --- a/plugins/modules/docker_network_info.py +++ b/plugins/modules/docker_network_info.py @@ -26,7 +26,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.api_documentation diff --git a/plugins/modules/docker_node.py b/plugins/modules/docker_node.py index c96e6b1a..a1142f75 100644 --- a/plugins/modules/docker_node.py +++ b/plugins/modules/docker_node.py @@ -22,7 +22,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 999c100d..3b2258c6 100644 --- a/plugins/modules/docker_node_info.py +++ b/plugins/modules/docker_node_info.py @@ -36,7 +36,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 8c2d7bfd..407d1c64 100644 --- a/plugins/modules/docker_prune.py +++ b/plugins/modules/docker_prune.py @@ -24,7 +24,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. @@ -36,7 +36,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. @@ -48,7 +48,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. @@ -59,7 +59,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: description: - Whether to prune the builder cache. type: bool - default: no + default: false extends_documentation_fragment: - community.docker.docker.api_documentation @@ -86,28 +86,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 3dd32648..77c5e168 100644 --- a/plugins/modules/docker_secret.py +++ b/plugins/modules/docker_secret.py @@ -34,7 +34,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. @@ -51,7 +51,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. @@ -71,7 +71,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. @@ -155,7 +155,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 031afe2e..f8124238 100644 --- a/plugins/modules/docker_stack.py +++ b/plugins/modules/docker_stack.py @@ -22,7 +22,7 @@ options: description: - Stack name type: str - required: yes + required: true state: description: - Service state. @@ -45,13 +45,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 b09a738e..a463d439 100644 --- a/plugins/modules/docker_stack_task_info.py +++ b/plugins/modules/docker_stack_task_info.py @@ -22,7 +22,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 afc58ca8..473e20f8 100644 --- a/plugins/modules/docker_swarm.py +++ b/plugins/modules/docker_swarm.py @@ -60,7 +60,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. @@ -165,17 +165,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 ff59bab2..55e003e1 100644 --- a/plugins/modules/docker_swarm_info.py +++ b/plugins/modules/docker_swarm_info.py @@ -32,7 +32,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. @@ -44,7 +44,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. @@ -56,7 +56,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. @@ -68,16 +68,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 @@ -91,7 +91,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 @@ -105,18 +105,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 @@ -126,7 +126,7 @@ EXAMPLES = ''' - name: Get the swarm unlock key community.docker.docker_swarm_info: - unlock_key: yes + unlock_key: true register: result - ansible.builtin.debug: @@ -168,25 +168,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 29ffbb35..0d72110d 100644 --- a/plugins/modules/docker_swarm_service.py +++ b/plugins/modules/docker_swarm_service.py @@ -47,7 +47,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. @@ -117,7 +117,7 @@ options: - Force update even if no changes require it. - Corresponds to the C(--force) option of C(docker service update). type: bool - default: no + default: false groups: description: - List of additional group names and/or IDs that the container process will run as. @@ -241,7 +241,7 @@ options: description: - Container path. type: str - required: yes + required: true type: description: - The mount type. @@ -309,7 +309,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. @@ -356,12 +356,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. @@ -415,7 +415,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. @@ -512,7 +512,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 e242624a..cd94cbf8 100644 --- a/plugins/modules/docker_swarm_service_info.py +++ b/plugins/modules/docker_swarm_service_info.py @@ -25,7 +25,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 6fe37eb4..0c64e285 100644 --- a/plugins/modules/docker_volume.py +++ b/plugins/modules/docker_volume.py @@ -20,7 +20,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 51372b96..0fb919d3 100644 --- a/plugins/modules/docker_volume_info.py +++ b/plugins/modules/docker_volume_info.py @@ -19,7 +19,7 @@ options: description: - Name of the volume to inspect. type: str - required: yes + required: true aliases: - volume_name