Use true and false instead of yes and no for boolean values

Story: 2010586
Task: 47380
Change-Id: I1b88aa925d823d74b2d012153dfe26d35c93dfd5
This commit is contained in:
Jakob Meng 2023-02-21 09:32:35 +01:00
parent b6b5f63877
commit f73a0e385e
23 changed files with 77 additions and 77 deletions

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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)

View File

@ -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

View File

@ -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'

View File

@ -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

View File

@ -90,4 +90,4 @@
cloud: "{{ cloud }}"
state: absent
name: ansible_container2
delete_with_all_objects: yes
delete_with_all_objects: true

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -32,7 +32,7 @@ options:
description:
- Whether the user is enabled or not.
type: bool
default: 'yes'
default: 'true'
aliases: ['enabled']
name:
description:

View File

@ -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
'''

View File

@ -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.

View File

@ -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:

View File

@ -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']

View File

@ -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
'''

View File

@ -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

View File

@ -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