Skip to content

Commit

Permalink
Adjust booleans from yes/no to true/false (ansible-collections#978)
Browse files Browse the repository at this point in the history
Adjust booleans from yes/no to true/false

SUMMARY

As per ansible-community/community-topics#116
See also ansible-collections#1420
Closes: ansible-collections#1041
ISSUE TYPE


Docs Pull Request

COMPONENT NAME

several
ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell <None>
Reviewed-by: Bikouo Aubin <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
  • Loading branch information
alinabuzachis authored Sep 21, 2022
1 parent b40b6f1 commit b4298bd
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 29 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/978-bools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trivial:
- various modules - Adjust booleans from ``yes``/``no`` to ``true``/``false`` in docs (https://github.com/ansible-collections/amazon.aws/pull/978).
2 changes: 1 addition & 1 deletion plugins/modules/cloudformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
stack_name: my_stack
state: present
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
termination_protection: yes
termination_protection: true
# Configure TimeoutInMinutes before the stack status becomes CREATE_FAILED
# In this case, if disable_rollback is not set or is set to false, the stack will be rolled back.
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/cloudformation_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
- name: try to get info about a stack but fail if it doesn't exist
amazon.aws.cloudformation_info:
stack_name: nonexistent-stack
all_facts: yes
all_facts: true
failed_when: cloudformation['nonexistent-stack'] is undefined
'''

Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/ec2_ami.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
type: str
description:
- The device name. For example C(/dev/sda).
required: yes
required: true
virtual_name:
type: str
description:
Expand Down Expand Up @@ -162,7 +162,7 @@
- name: Basic AMI Creation
amazon.aws.ec2_ami:
instance_id: i-xxxxxx
wait: yes
wait: true
name: newtest
tags:
Name: newtest
Expand Down Expand Up @@ -212,7 +212,7 @@
delete_on_termination: true
volume_type: gp2
- device_name: /dev/sdb
no_device: yes
no_device: true
- name: Deregister/Delete AMI (keep associated snapshots)
amazon.aws.ec2_ami:
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/ec2_ami_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
describe_image_attributes:
description:
- Describe attributes (like launchPermission) of the images found.
default: no
default: false
type: bool
extends_documentation_fragment:
Expand Down Expand Up @@ -140,7 +140,7 @@
sample: machine
launch_permissions:
description: A List of AWS accounts may launch the AMI.
returned: When image is owned by calling account and I(describe_image_attributes) is yes.
returned: When image is owned by calling account and I(describe_image_attributes=true).
type: list
elements: dict
contains:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
- Wait for the snapshot to be ready.
type: bool
required: false
default: yes
default: true
wait_timeout:
description:
- How long before wait gives up, in seconds.
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/ec2_vol.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
- amazon.aws.ec2:
keypair: "{{ keypair }}"
image: "{{ image }}"
wait: yes
wait: true
count: 3
register: ec2
- amazon.aws.ec2_vol:
Expand All @@ -160,7 +160,7 @@
image: "{{ image }}"
zone: YYYYYY
id: my_instance
wait: yes
wait: true
count: 1
register: ec2
Expand Down Expand Up @@ -202,7 +202,7 @@
instance: XXXXXX
id: XXXXXX
device_name: /dev/sdf
delete_on_termination: yes
delete_on_termination: true
'''

RETURN = '''
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_vpc_dhcp_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
will be ignored, and the old DHCP option set will be preserved, if it
is in use by any other VPC. (Otherwise, AWS will return an error.)
type: bool
default: 'yes'
default: true
inherit_existing:
description:
- For any DHCP options not specified in these parameters, whether to
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_vpc_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
- Unfortunately this is ignored for delete actions due to a difference in
behaviour from AWS.
required: false
default: no
default: false
type: bool
wait_timeout:
description:
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/ec2_vpc_nat_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
state: absent
nat_gateway_id: nat-12345678
release_eip: true
wait: yes
wait: true
wait_timeout: 300
region: ap-southeast-2
Expand All @@ -172,10 +172,10 @@
subnet_id: subnet-12345678
allocation_id: eipalloc-12345678
region: ap-southeast-2
purge_tags: no
purge_tags: false
tags:
Tag3: tag3
wait: yes
wait: true
register: update_tags_nat_gateway
'''

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_vpc_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
purge_cidrs:
description:
- Remove CIDRs that are associated with the VPC and are not specified in I(cidr_block).
default: no
default: false
type: bool
tenancy:
description:
Expand Down
14 changes: 7 additions & 7 deletions plugins/modules/elb_classic_lb.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,13 @@
- amazon.aws.elb_classic_lb:
name: "test-please-delete"
state: absent
wait: yes
wait: true
# Ensure ELB is gone and wait for check with timeout value
- amazon.aws.elb_classic_lb:
name: "test-please-delete"
state: absent
wait: yes
wait: true
wait_timeout: 600
# Normally, this module will purge any listeners that exist on the ELB
Expand All @@ -382,7 +382,7 @@
- protocol: http
load_balancer_port: 80
instance_port: 80
purge_listeners: no
purge_listeners: false
# Normally, this module will leave availability zones that are enabled
# on the ELB alone. If purge_zones is true, then any extraneous zones
Expand All @@ -397,15 +397,15 @@
- protocol: http
load_balancer_port: 80
instance_port: 80
purge_zones: yes
purge_zones: true
# Creates a ELB and assigns a list of subnets to it.
- amazon.aws.elb_classic_lb:
state: present
name: 'New ELB'
security_group_ids: 'sg-123456, sg-67890'
subnets: 'subnet-123456,subnet-67890'
purge_subnets: yes
purge_subnets: true
listeners:
- protocol: http
load_balancer_port: 80
Expand Down Expand Up @@ -440,7 +440,7 @@
instance_port: 80
stickiness:
type: loadbalancer
enabled: yes
enabled: true
expiration: 300
# Create an ELB with application stickiness enabled
Expand All @@ -456,7 +456,7 @@
instance_port: 80
stickiness:
type: application
enabled: yes
enabled: true
cookie: SESSIONID
# Create an ELB and add tags
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/s3_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
- When trying to delete a bucket, delete all keys (including versions and delete markers)
in the bucket first (an S3 bucket must be empty for a successful deletion).
type: bool
default: 'no'
default: false
name:
description:
- Name of the S3 bucket.
Expand Down Expand Up @@ -192,14 +192,14 @@
- amazon.aws.s3_bucket:
name: mys3bucket
state: absent
force: yes
force: true
# Create a bucket, add a policy from a file, enable requester pays, enable versioning and tag
- amazon.aws.s3_bucket:
name: mys3bucket
policy: "{{ lookup('file','policy.json') }}"
requester_pays: yes
versioning: yes
requester_pays: true
versioning: true
tags:
example: tag1
another: tag2
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/s3_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def main():
overwrite=dict(aliases=['force'], default='different'),
prefix=dict(default=""),
retries=dict(aliases=['retry'], type='int', default=0),
dualstack=dict(default='no', type='bool'),
dualstack=dict(default=False, type='bool'),
ceph=dict(default=False, type='bool', aliases=['rgw']),
src=dict(type='path'),
content=dict(),
Expand Down

0 comments on commit b4298bd

Please sign in to comment.