From f73a0e385e9283718cd5cdc5172617b2b408dc7a Mon Sep 17 00:00:00 2001 From: Jakob Meng Date: Tue, 21 Feb 2023 09:32:35 +0100 Subject: [PATCH] Use true and false instead of yes and no for boolean values Story: 2010586 Task: 47380 Change-Id: I1b88aa925d823d74b2d012153dfe26d35c93dfd5 --- ci/roles/federation_mapping/tasks/main.yml | 14 +++++----- ci/roles/floating_ip/tasks/main.yml | 8 +++--- ci/roles/identity_user/tasks/main.yml | 4 +-- ci/roles/keypair/tasks/main.yml | 2 +- .../tasks/main.yml | 24 ++++++++-------- ci/roles/keystone_idp/tasks/main.yml | 28 +++++++++---------- ci/roles/network/tasks/main.yml | 2 +- ci/roles/object_container/tasks/main.yml | 2 +- ci/roles/port/tasks/main.yml | 4 +-- ci/roles/server/tasks/main.yml | 8 +++--- plugins/doc_fragments/openstack.py | 4 +-- plugins/modules/address_scope.py | 2 +- plugins/modules/baremetal_node_action.py | 4 +-- plugins/modules/coe_cluster_template.py | 2 +- plugins/modules/floating_ip.py | 6 ++-- plugins/modules/identity_user.py | 2 +- plugins/modules/loadbalancer.py | 2 +- plugins/modules/port.py | 4 +-- plugins/modules/router.py | 2 +- plugins/modules/server.py | 20 ++++++------- plugins/modules/server_info.py | 4 +-- plugins/modules/subnet.py | 4 +-- plugins/modules/volume_snapshot.py | 2 +- 23 files changed, 77 insertions(+), 77 deletions(-) diff --git a/ci/roles/federation_mapping/tasks/main.yml b/ci/roles/federation_mapping/tasks/main.yml index 89c7e2ae..9c64ddd0 100644 --- a/ci/roles/federation_mapping/tasks/main.yml +++ b/ci/roles/federation_mapping/tasks/main.yml @@ -19,7 +19,7 @@ name: '{{ mapping_name }}' rules: '{{ mapping_rules_1 }}' register: create_mapping - check_mode: yes + check_mode: true - assert: that: @@ -91,7 +91,7 @@ name: '{{ mapping_name }}' rules: '{{ mapping_rules_1 }}' register: create_mapping - check_mode: yes + check_mode: true - assert: that: @@ -117,7 +117,7 @@ name: '{{ mapping_name }}' rules: '{{ mapping_rules_2 }}' register: update_mapping - check_mode: yes + check_mode: true - assert: that: @@ -196,7 +196,7 @@ state: 'absent' name: '{{ mapping_name }}' register: delete_mapping - check_mode: yes + check_mode: true - assert: that: @@ -217,7 +217,7 @@ state: 'absent' name: '{{ mapping_name }}' register: delete_mapping - check_mode: yes + check_mode: true - assert: that: @@ -257,10 +257,10 @@ openstack.cloud.federation_mapping: state: 'absent' name: '{{ mapping_name }}' - ignore_errors: yes + ignore_errors: true - name: 'Delete second mapping' openstack.cloud.federation_mapping: state: 'absent' name: '{{ mapping_name_2 }}' - ignore_errors: yes + ignore_errors: true diff --git a/ci/roles/floating_ip/tasks/main.yml b/ci/roles/floating_ip/tasks/main.yml index 2d844580..76285f0e 100644 --- a/ci/roles/floating_ip/tasks/main.yml +++ b/ci/roles/floating_ip/tasks/main.yml @@ -214,7 +214,7 @@ cloud: "{{ cloud }}" state: present server: ansible_server1 - wait: yes + wait: true - name: Get floating ip attached to server 1 openstack.cloud.floating_ip_info: @@ -302,7 +302,7 @@ openstack.cloud.floating_ip: cloud: "{{ cloud }}" state: present - reuse: no # else fixed_address will be ignored + reuse: false # else fixed_address will be ignored server: ansible_server2 network: public fixed_address: "{{ port2.port.fixed_ips[0].ip_address }}" @@ -347,12 +347,12 @@ openstack.cloud.floating_ip: cloud: "{{ cloud }}" state: present - reuse: no # else fixed_address will be ignored + reuse: false # else fixed_address will be ignored server: ansible_server2 network: ansible_external fixed_address: "{{ port3.port.fixed_ips[0].ip_address }}" floating_ip_address: "10.6.6.150" - wait: no # does not work anyway and causes issues in local testing + wait: false # does not work anyway and causes issues in local testing - name: Get floating ip attached to server 2 openstack.cloud.floating_ip_info: diff --git a/ci/roles/identity_user/tasks/main.yml b/ci/roles/identity_user/tasks/main.yml index 37f123e0..cb27f14a 100644 --- a/ci/roles/identity_user/tasks/main.yml +++ b/ci/roles/identity_user/tasks/main.yml @@ -28,7 +28,7 @@ domain: default default_project: demo register: user - ignore_errors: yes + ignore_errors: true - name: Assert that update failed assert: @@ -93,7 +93,7 @@ update_password: always email: updated.ansible.user@nowhere.net register: user - ignore_errors: yes + ignore_errors: true - name: Assert user update failed assert: diff --git a/ci/roles/keypair/tasks/main.yml b/ci/roles/keypair/tasks/main.yml index b3154153..09e539c1 100644 --- a/ci/roles/keypair/tasks/main.yml +++ b/ci/roles/keypair/tasks/main.yml @@ -78,7 +78,7 @@ - name: Generate test key file user: name: "{{ ansible_env.USER }}" - generate_ssh_key: yes + generate_ssh_key: true ssh_key_file: .ssh/shade_id_rsa - name: Create keypair (file) diff --git a/ci/roles/keystone_federation_protocol/tasks/main.yml b/ci/roles/keystone_federation_protocol/tasks/main.yml index 80c5c9ea..2f802e01 100644 --- a/ci/roles/keystone_federation_protocol/tasks/main.yml +++ b/ci/roles/keystone_federation_protocol/tasks/main.yml @@ -78,7 +78,7 @@ # Creation - name: Create protocol - CHECK MODE - check_mode: yes + check_mode: true openstack.cloud.keystone_federation_protocol: state: present name: ansible_protocol1 @@ -119,7 +119,7 @@ - expected_fields|difference(protocol.protocol.keys())|length == 0 - name: Create protocol (retry - no change) - CHECK MODE - check_mode: yes + check_mode: true openstack.cloud.keystone_federation_protocol: state: present name: ansible_protocol1 @@ -148,7 +148,7 @@ # Update - name: Update protocol - CHECK MODE - check_mode: yes + check_mode: true openstack.cloud.keystone_federation_protocol: state: present name: ansible_protocol1 @@ -174,7 +174,7 @@ - protocol.protocol.mapping_id == 'ansible_mapping2' - name: Update protocol (retry - no change) - CHECK MODE - check_mode: yes + check_mode: true openstack.cloud.keystone_federation_protocol: state: present name: ansible_protocol1 @@ -258,7 +258,7 @@ # Deletion - name: Delete protocol - CHECK MODE - check_mode: yes + check_mode: true openstack.cloud.keystone_federation_protocol: state: absent name: ansible_protocol1 @@ -279,7 +279,7 @@ - protocol is changed - name: Delete protocol (retry - no change) - CHECK MODE - check_mode: yes + check_mode: true openstack.cloud.keystone_federation_protocol: state: absent name: ansible_protocol1 @@ -307,35 +307,35 @@ state: absent name: ansible_protocol1 idp_id: ansible_idp - ignore_errors: yes + ignore_errors: true - name: Delete protocol (2) openstack.cloud.keystone_federation_protocol: state: absent name: ansible_protocol2 idp_id: ansible_idp - ignore_errors: yes + ignore_errors: true - name: Delete mapping 1 openstack.cloud.federation_mapping: state: absent name: ansible_mapping1 - ignore_errors: yes + ignore_errors: true - name: Delete mapping 2 openstack.cloud.federation_mapping: state: absent name: ansible_mapping2 - ignore_errors: yes + ignore_errors: true - name: Delete idp openstack.cloud.federation_idp: state: absent name: ansible_idp - ignore_errors: yes + ignore_errors: true - name: Delete domain openstack.cloud.identity_domain: state: absent name: ansible_domain - ignore_errors: yes + ignore_errors: true diff --git a/ci/roles/keystone_idp/tasks/main.yml b/ci/roles/keystone_idp/tasks/main.yml index 2434c4ad..7b231c25 100644 --- a/ci/roles/keystone_idp/tasks/main.yml +++ b/ci/roles/keystone_idp/tasks/main.yml @@ -116,7 +116,7 @@ _idps: '{{ idps.identity_providers }}' - name: 'Create identity_provider (retry - no change) - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider' @@ -150,7 +150,7 @@ # Update (simple cases) - name: 'Update IDP set description - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider' @@ -181,7 +181,7 @@ _idp: '{{ idp.identity_provider }}' - name: 'Update IDP set description (retry - no change) - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider' @@ -213,7 +213,7 @@ - name: 'Update IDP set Remote IDs - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider' @@ -244,7 +244,7 @@ _idp: '{{ idp.identity_provider }}' - name: 'Update IDP set Remote IDs (retry - no change) - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider' @@ -275,7 +275,7 @@ _idp: '{{ idp.identity_provider }}' - name: 'Update IDP set Enabled - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider' @@ -306,7 +306,7 @@ _idp: '{{ idp.identity_provider }}' - name: 'Update IDP set Enabled (retry - no change) - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider' @@ -338,7 +338,7 @@ # If we don't specify anything to change, then nothing should change... - name: 'Minimal call to IDP (no change) - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider' @@ -371,7 +371,7 @@ # Update (mass-update) - name: 'Update all updatable IDP parameters - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider' @@ -406,7 +406,7 @@ _idp: '{{ idp.identity_provider }}' - name: 'Update all updatable IDP parameters (no change) - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider' @@ -444,7 +444,7 @@ # Create complex IDP - name: 'Create complex IDP - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider2' @@ -481,7 +481,7 @@ _idp: '{{ idp.identity_provider }}' - name: 'Create complex IDP (retry - no change) - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: present name: 'ansible_identity_provider2' @@ -558,7 +558,7 @@ - False in (idps.identity_providers | map(attribute='is_enabled')) - name: 'Delete identity_provider - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: absent name: 'ansible_identity_provider' @@ -579,7 +579,7 @@ - idp is changed - name: 'Delete identity_provider (retry - no change) - CHECK_MODE' - check_mode: yes + check_mode: true openstack.cloud.federation_idp: state: absent name: 'ansible_identity_provider' diff --git a/ci/roles/network/tasks/main.yml b/ci/roles/network/tasks/main.yml index f84debc8..748aea9a 100644 --- a/ci/roles/network/tasks/main.yml +++ b/ci/roles/network/tasks/main.yml @@ -23,7 +23,7 @@ - name: Check output of network info # TODO: Remove ignore_errors once SDK's search_networks() (re)implemented searching by id - ignore_errors: yes + ignore_errors: true assert: that: - result.networks|length == 1 diff --git a/ci/roles/object_container/tasks/main.yml b/ci/roles/object_container/tasks/main.yml index ce4cbb5d..e2a81353 100644 --- a/ci/roles/object_container/tasks/main.yml +++ b/ci/roles/object_container/tasks/main.yml @@ -90,4 +90,4 @@ cloud: "{{ cloud }}" state: absent name: ansible_container2 - delete_with_all_objects: yes + delete_with_all_objects: true diff --git a/ci/roles/port/tasks/main.yml b/ci/roles/port/tasks/main.yml index faef919b..561202f7 100644 --- a/ci/roles/port/tasks/main.yml +++ b/ci/roles/port/tasks/main.yml @@ -169,7 +169,7 @@ - ip_address: 10.5.5.69 name: "{{ port_name }}" network: "{{ network_name }}" - no_security_groups: yes + no_security_groups: true state: present register: port @@ -192,7 +192,7 @@ subnet_id: "{{ subnet.subnet.id }}" name: "{{ port_name }}" network: "{{ network_name }}" - no_security_groups: yes + no_security_groups: true state: present register: port_again diff --git a/ci/roles/server/tasks/main.yml b/ci/roles/server/tasks/main.yml index 5e9ef9e0..40fde692 100644 --- a/ci/roles/server/tasks/main.yml +++ b/ci/roles/server/tasks/main.yml @@ -224,7 +224,7 @@ register: info # TODO: Drop ignore_errors once openstacksdk's bug #2010135 has been solved. # Ref.: https://storyboard.openstack.org/#!/story/2010135 - ignore_errors: yes + ignore_errors: true - name: Check info about server image name assert: @@ -232,7 +232,7 @@ - info.servers[0].image.name == image_name # TODO: Drop ignore_errors once openstacksdk's bug #2010135 has been solved. # Ref.: https://storyboard.openstack.org/#!/story/2010135 - ignore_errors: yes + ignore_errors: true - name: Delete server (FIP from pool/network) openstack.cloud.server: @@ -375,7 +375,7 @@ state: present name: "{{ server_port }}" network: "{{ server_network }}" - no_security_groups: yes + no_security_groups: true fixed_ips: - ip_address: 192.168.0.42 register: port @@ -555,7 +555,7 @@ - name: Delete updated server openstack.cloud.server: cloud: "{{ cloud }}" - delete_ips: yes + delete_ips: true name: "{{ server_name }}" state: absent wait: true diff --git a/plugins/doc_fragments/openstack.py b/plugins/doc_fragments/openstack.py index ff9bc646..5b12077c 100644 --- a/plugins/doc_fragments/openstack.py +++ b/plugins/doc_fragments/openstack.py @@ -46,7 +46,7 @@ options: description: - Should ansible wait until the requested resource is complete. type: bool - default: yes + default: true timeout: description: - How long should ansible wait for the requested resource. @@ -60,7 +60,7 @@ options: validate_certs: description: - Whether or not SSL API requests should be verified. - - Before Ansible 2.3 this defaulted to C(yes). + - Before Ansible 2.3 this defaulted to C(true). type: bool aliases: [ verify ] ca_cert: diff --git a/plugins/modules/address_scope.py b/plugins/modules/address_scope.py index a2592147..3a0d5ce4 100644 --- a/plugins/modules/address_scope.py +++ b/plugins/modules/address_scope.py @@ -40,7 +40,7 @@ options: description: - Whether this address scope is shared or not. type: bool - default: 'no' + default: 'false' aliases: ['shared'] extra_specs: description: diff --git a/plugins/modules/baremetal_node_action.py b/plugins/modules/baremetal_node_action.py index 6af6c1c7..a74c65ea 100644 --- a/plugins/modules/baremetal_node_action.py +++ b/plugins/modules/baremetal_node_action.py @@ -93,10 +93,10 @@ EXAMPLES = r''' image_checksum: "356a6b55ecc511a20c33c946c4e678af" image_disk_format: "qcow" delegate_to: localhost - deploy: yes + deploy: true cloud: "openstack" config_drive: "http://192.168.1.1/host-configdrive.iso" - maintenance: no + maintenance: false power: present uuid: "d44666e1-35b3-4f6b-acb0-88ab7052da69" state: present diff --git a/plugins/modules/coe_cluster_template.py b/plugins/modules/coe_cluster_template.py index 9704b862..ecc3a688 100644 --- a/plugins/modules/coe_cluster_template.py +++ b/plugins/modules/coe_cluster_template.py @@ -317,7 +317,7 @@ EXAMPLES = r''' image_id: 2a8c9888-9054-4b06-a1ca-2bb61f9adb72 keypair_id: mykey name: k8s - is_public: no + is_public: false ''' from ansible_collections.openstack.cloud.plugins.module_utils.openstack import OpenStackModule diff --git a/plugins/modules/floating_ip.py b/plugins/modules/floating_ip.py index ed192136..265f1684 100644 --- a/plugins/modules/floating_ip.py +++ b/plugins/modules/floating_ip.py @@ -42,7 +42,7 @@ options: floating IP completely, or only detach it from the server. Default is to detach only. type: bool - default: 'no' + default: 'false' reuse: description: - When I(state) is present, and I(floating_ip_address) is not present, @@ -52,7 +52,7 @@ options: I(floating_ip_address) is undefined, then C(nat_destination) and C(fixed_address) will be ignored. type: bool - default: 'no' + default: 'false' server: description: - The name or ID of the server to which the IP address @@ -83,7 +83,7 @@ EXAMPLES = ''' - openstack.cloud.floating_ip: cloud: dguerri state: present - reuse: yes + reuse: true server: cattle001 network: ext_net fixed_address: 192.0.2.3 diff --git a/plugins/modules/identity_user.py b/plugins/modules/identity_user.py index c4e7dff6..dfcf1cfd 100644 --- a/plugins/modules/identity_user.py +++ b/plugins/modules/identity_user.py @@ -32,7 +32,7 @@ options: description: - Whether the user is enabled or not. type: bool - default: 'yes' + default: 'true' aliases: ['enabled'] name: description: diff --git a/plugins/modules/loadbalancer.py b/plugins/modules/loadbalancer.py index 8f024b32..d2addb73 100644 --- a/plugins/modules/loadbalancer.py +++ b/plugins/modules/loadbalancer.py @@ -258,7 +258,7 @@ EXAMPLES = r''' - name: Delete a load balancer, its related resources and its floating ip openstack.cloud.loadbalancer: cloud: devstack - delete_floating_ip: yes + delete_floating_ip: true name: my_lb state: absent ''' diff --git a/plugins/modules/port.py b/plugins/modules/port.py index fa3598b2..123fab27 100644 --- a/plugins/modules/port.py +++ b/plugins/modules/port.py @@ -135,9 +135,9 @@ options: description: - Do not associate a security group with this port. - "Deprecated. Use I(security_groups): C([]) instead - of I(no_security_groups): C(yes)." + of I(no_security_groups): C(true)." type: bool - default: 'no' + default: 'false' port_security_enabled: description: - Whether to enable or disable the port security on the network. diff --git a/plugins/modules/router.py b/plugins/modules/router.py index e8d443b1..c82819f4 100644 --- a/plugins/modules/router.py +++ b/plugins/modules/router.py @@ -87,7 +87,7 @@ options: description: - Desired admin state of the created or existing router. type: bool - default: 'yes' + default: 'true' aliases: ['admin_state_up'] name: description: diff --git a/plugins/modules/server.py b/plugins/modules/server.py index 7d99c353..d7179902 100644 --- a/plugins/modules/server.py +++ b/plugins/modules/server.py @@ -27,7 +27,7 @@ options: attaching and detaching of floating ip addresses use module I(openstack.cloud.resource) instead. type: bool - default: 'yes' + default: 'true' aliases: ['auto_floating_ip', 'public_ip'] availability_zone: description: @@ -40,7 +40,7 @@ options: the image given. Mutually exclusive with boot_volume. - This server attribute cannot be updated. type: bool - default: 'no' + default: 'false' boot_volume: description: - Volume name or id to use as the volume to boot from. Implies @@ -53,7 +53,7 @@ options: - Whether to boot the server with config drive enabled. - This server attribute cannot be updated. type: bool - default: 'no' + default: 'false' delete_ips: description: - When I(state) is C(absent) and this option is true, any floating IP @@ -61,7 +61,7 @@ options: - Floating IP support is unstable in this module, use with caution. type: bool aliases: ['delete_fip'] - default: 'no' + default: 'false' description: description: - Description of the server. @@ -183,7 +183,7 @@ options: - Floating IP support is unstable in this module, use with caution. - This server attribute cannot be updated. type: bool - default: 'yes' + default: 'true' scheduler_hints: description: - Arbitrary key/value pairs to the scheduler for custom use. @@ -207,11 +207,11 @@ options: type: str terminate_volume: description: - - If C(yes), delete volume when deleting the instance and if it has + - If C(true), delete volume when deleting the instance and if it has been booted from volume(s). - This server attribute cannot be updated. type: bool - default: 'no' + default: 'false' timeout: description: - The amount of time the module should wait for the instance to get @@ -240,7 +240,7 @@ options: description: - If the module should wait for the instance to be created. type: bool - default: 'yes' + default: 'true' extends_documentation_fragment: - openstack.cloud.openstack ''' @@ -288,7 +288,7 @@ EXAMPLES = ''' flavor: 101 security_groups: - default - auto_ip: yes + auto_ip: true # Create a new instance in named cloud mordred availability zone az2 # and assigns a pre-known floating IP @@ -1038,7 +1038,7 @@ class ServerModule(OpenStackModule): # we wait until the server has been created # Ref.: https://opendev.org/openstack/openstacksdk/src/commit/3f81d0001dd994cde990d38f6e2671ee0694d7d5/openstack/cloud/_compute.py#L945 self.fail_json( - msg="Option '{0}' requires 'wait: yes'".format(k)) + msg="Option '{0}' requires 'wait: true'".format(k)) flavor_name_or_id = self.params['flavor'] diff --git a/plugins/modules/server_info.py b/plugins/modules/server_info.py index bbd7de88..6ab87952 100644 --- a/plugins/modules/server_info.py +++ b/plugins/modules/server_info.py @@ -25,7 +25,7 @@ options: - when true, return additional detail about servers at the expense of additional API calls. type: bool - default: 'no' + default: 'false' filters: description: | Used for further filtering of results. Either a string containing a @@ -37,7 +37,7 @@ options: - Whether to list servers from all projects or just the current auth scoped project. type: bool - default: 'no' + default: 'false' extends_documentation_fragment: - openstack.cloud.openstack ''' diff --git a/plugins/modules/subnet.py b/plugins/modules/subnet.py index 2f55e144..d8da4b5d 100644 --- a/plugins/modules/subnet.py +++ b/plugins/modules/subnet.py @@ -43,7 +43,7 @@ options: - The gateway IP would not be assigned for this subnet type: bool aliases: ['no_gateway_ip'] - default: 'no' + default: 'false' dns_nameservers: description: - List of DNS nameservers for this subnet. @@ -85,7 +85,7 @@ options: - Whether DHCP should be enabled for this subnet. type: bool aliases: ['enable_dhcp'] - default: 'yes' + default: 'true' ipv6_ra_mode: description: - IPv6 router advertisement mode diff --git a/plugins/modules/volume_snapshot.py b/plugins/modules/volume_snapshot.py index 4f393d56..ebfc7d11 100644 --- a/plugins/modules/volume_snapshot.py +++ b/plugins/modules/volume_snapshot.py @@ -22,7 +22,7 @@ options: - Allows or disallows snapshot of a volume to be created, when the volume is attached to an instance. type: bool - default: 'no' + default: 'false' name: description: - Name of the snapshot