From e9301e47594df75b72a38adecd776d063825e6d4 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Wed, 22 Feb 2023 14:13:19 +0100 Subject: [PATCH] Bulk update to renamed docs fragments (#1382) Bulk update to renamed docs fragments SUMMARY Follow up to #1248, we renamed various docs fragments, clean-up amazon.aws ISSUE TYPE Docs Pull Request COMPONENT NAME various ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis --- changelogs/fragments/1382-docs.yml | 2 ++ plugins/inventory/aws_ec2.py | 8 +++---- plugins/inventory/aws_rds.py | 8 +++---- plugins/lookup/aws_collection_constants.py | 8 +++---- plugins/lookup/aws_service_ip_ranges.py | 8 +++---- plugins/modules/autoscaling_group.py | 16 +++++++------- plugins/modules/autoscaling_group_info.py | 16 +++++++------- plugins/modules/aws_az_info.py | 18 ++++++++-------- plugins/modules/aws_caller_info.py | 16 +++++++------- plugins/modules/cloudformation.py | 21 +++++++++++-------- plugins/modules/cloudformation_info.py | 18 ++++++++-------- plugins/modules/cloudtrail.py | 17 +++++++-------- plugins/modules/cloudtrail_info.py | 18 +++++++--------- plugins/modules/cloudwatch_metric_alarm.py | 12 +++++------ .../modules/cloudwatch_metric_alarm_info.py | 21 ++++++++----------- plugins/modules/cloudwatchevent_rule.py | 16 +++++++------- plugins/modules/cloudwatchlogs_log_group.py | 18 +++++++--------- .../modules/cloudwatchlogs_log_group_info.py | 16 +++++++------- .../cloudwatchlogs_log_group_metric_filter.py | 16 +++++++------- plugins/modules/ec2_ami.py | 16 +++++++------- plugins/modules/ec2_ami_info.py | 18 ++++++++-------- plugins/modules/ec2_eip.py | 16 +++++++------- plugins/modules/ec2_eip_info.py | 19 +++++++---------- plugins/modules/ec2_eni.py | 18 +++++++--------- plugins/modules/ec2_eni_info.py | 17 +++++++-------- plugins/modules/ec2_instance.py | 16 +++++++------- plugins/modules/ec2_instance_info.py | 20 ++++++++---------- plugins/modules/ec2_key.py | 16 +++++++------- plugins/modules/ec2_metadata_facts.py | 12 +++++------ plugins/modules/ec2_security_group.py | 4 ++-- plugins/modules/ec2_security_group_info.py | 19 ++++++++--------- plugins/modules/ec2_snapshot.py | 18 ++++++++-------- plugins/modules/ec2_snapshot_info.py | 17 +++++++-------- plugins/modules/ec2_spot_instance.py | 19 +++++++++-------- plugins/modules/ec2_spot_instance_info.py | 20 ++++++++---------- plugins/modules/ec2_tag.py | 18 ++++++++-------- plugins/modules/ec2_tag_info.py | 18 ++++++++-------- plugins/modules/ec2_vol.py | 16 +++++++------- plugins/modules/ec2_vol_info.py | 17 +++++++-------- plugins/modules/ec2_vpc_dhcp_option.py | 13 ++++++------ plugins/modules/ec2_vpc_dhcp_option_info.py | 17 +++++++-------- plugins/modules/ec2_vpc_endpoint.py | 16 +++++++------- plugins/modules/ec2_vpc_endpoint_info.py | 16 +++++++------- .../modules/ec2_vpc_endpoint_service_info.py | 16 +++++++------- plugins/modules/ec2_vpc_igw.py | 20 +++++++++--------- plugins/modules/ec2_vpc_igw_info.py | 18 ++++++++-------- plugins/modules/ec2_vpc_nat_gateway.py | 16 +++++++------- plugins/modules/ec2_vpc_nat_gateway_info.py | 18 ++++++++-------- plugins/modules/ec2_vpc_net.py | 16 +++++++------- plugins/modules/ec2_vpc_net_info.py | 19 ++++++++--------- plugins/modules/ec2_vpc_route_table.py | 16 +++++++------- plugins/modules/ec2_vpc_route_table_info.py | 18 ++++++++-------- plugins/modules/ec2_vpc_subnet.py | 16 +++++++------- plugins/modules/ec2_vpc_subnet_info.py | 18 ++++++++-------- plugins/modules/elb_application_lb.py | 18 ++++++++-------- plugins/modules/elb_application_lb_info.py | 17 +++++++-------- plugins/modules/elb_classic_lb.py | 14 ++++++------- plugins/modules/iam_policy.py | 16 +++++++------- plugins/modules/iam_policy_info.py | 17 +++++++-------- plugins/modules/iam_user.py | 16 +++++++------- plugins/modules/iam_user_info.py | 17 +++++++-------- plugins/modules/kms_key.py | 18 +++++++--------- plugins/modules/kms_key_info.py | 16 +++++++------- plugins/modules/lambda.py | 16 +++++++------- plugins/modules/lambda_alias.py | 17 +++++++-------- plugins/modules/lambda_event.py | 17 +++++++-------- plugins/modules/lambda_execute.py | 16 +++++++------- plugins/modules/lambda_info.py | 17 ++++++++------- plugins/modules/lambda_layer.py | 19 ++++++++--------- plugins/modules/lambda_layer_info.py | 19 ++++++++--------- plugins/modules/lambda_policy.py | 17 +++++++-------- plugins/modules/rds_cluster.py | 18 ++++++++-------- plugins/modules/rds_cluster_info.py | 17 +++++++-------- plugins/modules/rds_cluster_snapshot.py | 16 +++++++------- plugins/modules/rds_instance.py | 18 ++++++++-------- plugins/modules/rds_instance_info.py | 17 +++++++-------- plugins/modules/rds_instance_snapshot.py | 16 +++++++------- plugins/modules/rds_option_group.py | 16 +++++++------- plugins/modules/rds_option_group_info.py | 16 +++++++------- plugins/modules/rds_param_group.py | 17 +++++++-------- plugins/modules/rds_snapshot_info.py | 17 +++++++-------- plugins/modules/rds_subnet_group.py | 17 +++++++-------- plugins/modules/route53.py | 14 ++++++------- plugins/modules/route53_health_check.py | 17 +++++++-------- plugins/modules/route53_info.py | 17 +++++++-------- plugins/modules/route53_zone.py | 16 +++++++------- plugins/modules/s3_bucket.py | 12 +++++------ plugins/modules/s3_object.py | 6 +++--- plugins/modules/s3_object_info.py | 14 ++++++------- 89 files changed, 695 insertions(+), 733 deletions(-) create mode 100644 changelogs/fragments/1382-docs.yml diff --git a/changelogs/fragments/1382-docs.yml b/changelogs/fragments/1382-docs.yml new file mode 100644 index 00000000000..bd9f5ed2da8 --- /dev/null +++ b/changelogs/fragments/1382-docs.yml @@ -0,0 +1,2 @@ +trivial: +- bulk update module docs to use new fragment names (https://github.com/ansible-collections/amazon.aws/pull/1382). diff --git a/plugins/inventory/aws_ec2.py b/plugins/inventory/aws_ec2.py index 7a1e7627f6f..6844cce09d1 100644 --- a/plugins/inventory/aws_ec2.py +++ b/plugins/inventory/aws_ec2.py @@ -1,7 +1,7 @@ # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" name: aws_ec2 short_description: EC2 inventory source extends_documentation_fragment: @@ -133,9 +133,9 @@ - The suffix for host variables names coming from AWS. type: str version_added: 3.1.0 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Minimal example using environment vars or instance role credentials # Fetch all hosts in us-east-1, the hostname is the public DNS if it exists, otherwise the private IP address plugin: aws_ec2 @@ -251,7 +251,7 @@ - us-east-1 hostvars_prefix: 'aws_' hostvars_suffix: '_ec2' -''' +""" import re diff --git a/plugins/inventory/aws_rds.py b/plugins/inventory/aws_rds.py index f66f1230251..09296277371 100644 --- a/plugins/inventory/aws_rds.py +++ b/plugins/inventory/aws_rds.py @@ -1,7 +1,7 @@ # Copyright (c) 2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" name: aws_rds short_description: RDS instance inventory source description: @@ -57,9 +57,9 @@ - amazon.aws.assume_role.plugins author: - Sloane Hertel (@s-hertel) -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" plugin: aws_rds regions: - us-east-1 @@ -73,7 +73,7 @@ - key: region hostvars_prefix: aws_ hostvars_suffix: _rds -''' +""" try: import botocore diff --git a/plugins/lookup/aws_collection_constants.py b/plugins/lookup/aws_collection_constants.py index 7e907f7bc14..14fe0b4d741 100644 --- a/plugins/lookup/aws_collection_constants.py +++ b/plugins/lookup/aws_collection_constants.py @@ -1,7 +1,7 @@ # (c) 2023 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" name: aws_collection_constants author: - Mark Chappell (@tremble) @@ -21,12 +21,12 @@ - COMMUNITY_AWS_COLLECTION_VERSION - COMMUNITY_AWS_COLLECTION_NAME required: True -''' +""" -EXAMPLES = """ +EXAMPLES = r""" """ -RETURN = """ +RETURN = r""" _raw: description: value type: str diff --git a/plugins/lookup/aws_service_ip_ranges.py b/plugins/lookup/aws_service_ip_ranges.py index 38f2a997bda..1f50832136c 100644 --- a/plugins/lookup/aws_service_ip_ranges.py +++ b/plugins/lookup/aws_service_ip_ranges.py @@ -2,7 +2,7 @@ # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" name: aws_service_ip_ranges author: - James Turner (!UNKNOWN) @@ -20,9 +20,9 @@ ipv6_prefixes: description: 'When I(ipv6_prefixes=True) the lookup will return ipv6 addresses instead of ipv4 addresses' version_added: 2.1.0 -''' +""" -EXAMPLES = """ +EXAMPLES = r""" vars: ec2_ranges: "{{ lookup('aws_service_ip_ranges', region='ap-southeast-2', service='EC2', wantlist=True) }}" tasks: @@ -36,7 +36,7 @@ # "52.92.16.0/20,52.216.0.0/15,54.231.0.0/17" """ -RETURN = """ +RETURN = r""" _raw: description: comma-separated list of CIDR ranges """ diff --git a/plugins/modules/autoscaling_group.py b/plugins/modules/autoscaling_group.py index 64edfc5fadf..792faff1f9a 100644 --- a/plugins/modules/autoscaling_group.py +++ b/plugins/modules/autoscaling_group.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: autoscaling_group version_added: 5.0.0 @@ -331,12 +331,12 @@ type: list elements: str extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Basic configuration with Launch Configuration - amazon.aws.autoscaling_group: @@ -444,9 +444,9 @@ tags: - environment: production propagate_at_launch: false -''' +""" -RETURN = r''' +RETURN = r""" --- auto_scaling_group_name: description: The unique name of the auto scaling group @@ -648,7 +648,7 @@ "Metric": "GroupInServiceInstances" } ] -''' +""" import time diff --git a/plugins/modules/autoscaling_group_info.py b/plugins/modules/autoscaling_group_info.py index 1ac777e7ebd..41aafb4f8e8 100644 --- a/plugins/modules/autoscaling_group_info.py +++ b/plugins/modules/autoscaling_group_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: autoscaling_group_info version_added: 5.0.0 @@ -29,12 +29,12 @@ required: false type: dict extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Find all groups @@ -71,9 +71,9 @@ name: public-webserver-asg register: asgs failed_when: "{{ asgs.results | length > 1 }}" -''' +""" -RETURN = ''' +RETURN = r""" --- auto_scaling_group_arn: description: The Amazon Resource Name of the ASG @@ -234,7 +234,7 @@ returned: success type: str sample: ["Default"] -''' +""" import re diff --git a/plugins/modules/aws_az_info.py b/plugins/modules/aws_az_info.py index 21da7f52d2b..47df5fd4101 100644 --- a/plugins/modules/aws_az_info.py +++ b/plugins/modules/aws_az_info.py @@ -2,7 +2,7 @@ # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" module: aws_az_info short_description: Gather information about availability zones in AWS version_added: 1.0.0 @@ -22,12 +22,12 @@ default: {} type: dict extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all availability zones @@ -37,9 +37,9 @@ amazon.aws.aws_az_info: filters: zone-name: eu-west-1a -''' +""" -RETURN = ''' +RETURN = r""" availability_zones: returned: on success description: > @@ -137,7 +137,7 @@ "zone_type": "availability-zone" } ] -''' +""" try: from botocore.exceptions import ClientError, BotoCoreError diff --git a/plugins/modules/aws_caller_info.py b/plugins/modules/aws_caller_info.py index b89a10b1ca9..31de6af6fc8 100644 --- a/plugins/modules/aws_caller_info.py +++ b/plugins/modules/aws_caller_info.py @@ -2,7 +2,7 @@ # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: aws_caller_info version_added: 1.0.0 @@ -16,20 +16,20 @@ - Stijn Dubrul (@sdubrul) extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 +- amazon.aws.common.modules +- amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Get the current caller identity information amazon.aws.aws_caller_info: register: caller_info -''' +""" -RETURN = ''' +RETURN = r""" account: description: The account id the access credentials are associated with. returned: success @@ -52,7 +52,7 @@ returned: success type: str sample: 123456789012:my-federated-user-name -''' +""" try: from botocore.exceptions import BotoCoreError, ClientError diff --git a/plugins/modules/cloudformation.py b/plugins/modules/cloudformation.py index a1feeaafd9f..56e83f9b1ac 100644 --- a/plugins/modules/cloudformation.py +++ b/plugins/modules/cloudformation.py @@ -2,7 +2,7 @@ # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: cloudformation version_added: 1.0.0 @@ -158,12 +158,12 @@ author: - "James S. Martin (@jsmartin)" extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: create a cloudformation stack amazon.aws.cloudformation: stack_name: "ansible-cloudformation" @@ -275,14 +275,17 @@ state: present template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template on_create_failure: DELETE -''' +""" -RETURN = ''' +RETURN = r""" events: type: list description: Most recent events in CloudFormation's event log. This may be from a previous run in some cases. returned: always - sample: ["StackEvent AWS::CloudFormation::Stack stackname UPDATE_COMPLETE", "StackEvent AWS::CloudFormation::Stack stackname UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"] + sample: [ + "StackEvent AWS::CloudFormation::Stack stackname UPDATE_COMPLETE", + "StackEvent AWS::CloudFormation::Stack stackname UPDATE_COMPLETE_CLEANUP_IN_PROGRESS" + ] log: description: Debugging logs. Useful when modifying or finding an error. returned: always @@ -312,7 +315,7 @@ description: A key:value dictionary of all the stack outputs currently defined. If there are no stack outputs, it is an empty dictionary. returned: state == present sample: {"MySg": "AnsibleModuleTestYAML-CFTestSg-C8UVS567B6NS"} -''' # NOQA +""" import json import time diff --git a/plugins/modules/cloudformation_info.py b/plugins/modules/cloudformation_info.py index 9e06b0244db..cb48dbbe52d 100644 --- a/plugins/modules/cloudformation_info.py +++ b/plugins/modules/cloudformation_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: cloudformation_info version_added: 1.0.0 @@ -48,12 +48,12 @@ type: bool default: false extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Get information on all stacks @@ -96,9 +96,9 @@ stack_name: nonexistent-stack all_facts: true failed_when: cloudformation['nonexistent-stack'] is undefined -''' +""" -RETURN = ''' +RETURN = r""" cloudformation: description: - Dictionary of dictionaries containing info of stack(s). @@ -283,7 +283,7 @@ 'TagOne': 'ValueOne', 'TagTwo': 'ValueTwo' } -''' +""" import json diff --git a/plugins/modules/cloudtrail.py b/plugins/modules/cloudtrail.py index 041e9783b3e..fc4c47dbee0 100644 --- a/plugins/modules/cloudtrail.py +++ b/plugins/modules/cloudtrail.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: cloudtrail version_added: 5.0.0 @@ -89,14 +89,13 @@ - The I(purge_tags) option was added in release 4.0.0 extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" - name: create single region cloudtrail amazon.aws.cloudtrail: state: present @@ -145,9 +144,9 @@ amazon.aws.cloudtrail: state: absent name: default -''' +""" -RETURN = ''' +RETURN = r""" exists: description: whether the resource exists returned: always @@ -239,7 +238,7 @@ returned: success type: dict sample: {'environment': 'dev', 'Name': 'default'} -''' +""" try: from botocore.exceptions import ClientError, BotoCoreError diff --git a/plugins/modules/cloudtrail_info.py b/plugins/modules/cloudtrail_info.py index e133e7edb55..dcf3522a933 100644 --- a/plugins/modules/cloudtrail_info.py +++ b/plugins/modules/cloudtrail_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: cloudtrail_info version_added: 5.0.0 @@ -23,12 +23,12 @@ default: true description: Specifies whether to include shadow trails in the response. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all trails @@ -38,10 +38,9 @@ - amazon.aws.cloudtrail_info: trail_names: - arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail +""" -''' - -RETURN = ''' +RETURN = r""" trail_list: description: List of trail objects. Each element consists of a dict with all the information related to that cloudtrail. type: list @@ -147,8 +146,7 @@ type: dict returned: always sample: "{ 'my_tag_key': 'my_tag_value' }" - -''' +""" try: import botocore diff --git a/plugins/modules/cloudwatch_metric_alarm.py b/plugins/modules/cloudwatch_metric_alarm.py index 6188719528b..ef93b3db358 100644 --- a/plugins/modules/cloudwatch_metric_alarm.py +++ b/plugins/modules/cloudwatch_metric_alarm.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . -DOCUMENTATION = r''' +DOCUMENTATION = r""" module: cloudwatch_metric_alarm short_description: "Create/update or delete AWS CloudWatch 'metric alarms'" version_added: 5.0.0 @@ -246,12 +246,12 @@ - 'missing' default: 'missing' extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" - name: create alarm amazon.aws.cloudwatch_metric_alarm: state: present @@ -305,7 +305,7 @@ description: "This will recover an instance when it fails" dimensions: {"InstanceId":'i-XXX'} alarm_actions: ["arn:aws:automate:us-west-1:ec2:recover"] -''' +""" try: from botocore.exceptions import ClientError diff --git a/plugins/modules/cloudwatch_metric_alarm_info.py b/plugins/modules/cloudwatch_metric_alarm_info.py index e5e91c6fe1d..85b61b11572 100644 --- a/plugins/modules/cloudwatch_metric_alarm_info.py +++ b/plugins/modules/cloudwatch_metric_alarm_info.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://wwww.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: cloudwatch_metric_alarm_info version_added: 5.0.0 @@ -55,13 +55,12 @@ type: str extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: describe the metric alarm based on alarm names @@ -80,10 +79,9 @@ - name: describe the metric alarm based alarm names prefix amazon.aws.cloudwatch_metric_alarm_info: alarm_name_prefix: my-test- +""" -''' - -RETURN = ''' +RETURN = r""" metric_alarms: description: The gathered information about specified metric alarms. returned: when success @@ -219,8 +217,7 @@ description: This is the ID of the ANOMALY_DETECTION_BAND function used as the threshold for the alarm. returned: always type: str - -''' +""" try: diff --git a/plugins/modules/cloudwatchevent_rule.py b/plugins/modules/cloudwatchevent_rule.py index 749e1aa9e37..0a7d4cdc8ee 100644 --- a/plugins/modules/cloudwatchevent_rule.py +++ b/plugins/modules/cloudwatchevent_rule.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: cloudwatchevent_rule version_added: 5.0.0 @@ -11,8 +11,8 @@ - This module creates and manages CloudWatch event rules and targets. - This module was originally added to C(community.aws) in release 1.0.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 author: @@ -120,9 +120,9 @@ type: int description: The number of tasks to create based on I(task_definition). required: false -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" - amazon.aws.cloudwatchevent_rule: name: MyCronTask schedule_expression: "cron(0 20 * * ? *)" @@ -158,9 +158,9 @@ - amazon.aws.cloudwatchevent_rule: name: MyCronTask state: absent -''' +""" -RETURN = r''' +RETURN = r""" rule: description: CloudWatch Event rule data. returned: success @@ -176,7 +176,7 @@ returned: success type: list sample: "[{ 'arn': 'arn:aws:lambda:us-east-1:123456789012:function:MyFunction', 'id': 'MyTargetId' }]" -''' +""" import json diff --git a/plugins/modules/cloudwatchlogs_log_group.py b/plugins/modules/cloudwatchlogs_log_group.py index 35f8cfde900..40594f5f5a3 100644 --- a/plugins/modules/cloudwatchlogs_log_group.py +++ b/plugins/modules/cloudwatchlogs_log_group.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: cloudwatchlogs_log_group version_added: 5.0.0 @@ -55,14 +55,13 @@ required: false type: bool extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - amazon.aws.cloudwatchlogs_log_group: @@ -82,10 +81,9 @@ - amazon.aws.cloudwatchlogs_log_group: state: absent log_group_name: test-log-group +""" -''' - -RETURN = ''' +RETURN = r""" log_groups: description: Return the list of complex objects representing log groups returned: success @@ -125,7 +123,7 @@ description: A dictionary representing the tags on the log group. returned: always type: dict -''' +""" try: import botocore diff --git a/plugins/modules/cloudwatchlogs_log_group_info.py b/plugins/modules/cloudwatchlogs_log_group_info.py index 57e5145ccfc..ec02be69ef9 100644 --- a/plugins/modules/cloudwatchlogs_log_group_info.py +++ b/plugins/modules/cloudwatchlogs_log_group_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: cloudwatchlogs_log_group_info version_added: 5.0.0 @@ -18,18 +18,18 @@ - The name or prefix of the log group to filter by. type: str extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - amazon.aws.cloudwatchlogs_log_group_info: log_group_name: test-log-group -''' +""" -RETURN = ''' +RETURN = r""" log_groups: description: Return the list of complex objects representing log groups returned: success @@ -69,7 +69,7 @@ type: dict version_added: 4.0.0 version_added_collection: community.aws -''' +""" try: import botocore diff --git a/plugins/modules/cloudwatchlogs_log_group_metric_filter.py b/plugins/modules/cloudwatchlogs_log_group_metric_filter.py index d26b8364126..c918e35fbcb 100644 --- a/plugins/modules/cloudwatchlogs_log_group_metric_filter.py +++ b/plugins/modules/cloudwatchlogs_log_group_metric_filter.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: cloudwatchlogs_log_group_metric_filter version_added: 5.0.0 @@ -56,13 +56,12 @@ - The value to emit when a filter pattern does not match a log event. type: float extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" - name: set metric filter on log group /fluentd/testcase amazon.aws.cloudwatchlogs_log_group_metric_filter: log_group_name: /fluentd/testcase @@ -79,9 +78,9 @@ log_group_name: /fluentd/testcase filter_name: BoxFreeStorage state: absent -''' +""" -RETURN = """ +RETURN = r""" metric_filters: description: Return the origin response value returned: success @@ -94,7 +93,6 @@ "metric_value": "$.value" } ] - """ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict diff --git a/plugins/modules/ec2_ami.py b/plugins/modules/ec2_ami.py index c038cb6f084..05a8e5b09ea 100644 --- a/plugins/modules/ec2_ami.py +++ b/plugins/modules/ec2_ami.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_ami version_added: 1.0.0 @@ -167,15 +167,15 @@ - "Ross Williams (@gunzy83) " - "Willem van Ketwich (@wilvk) " extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" # Thank you to iAcquire for sponsoring development of this module. -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Basic AMI Creation @@ -274,9 +274,9 @@ state: present launch_permissions: user_ids: ['123456789012'] -''' +""" -RETURN = ''' +RETURN = r""" architecture: description: Architecture of image. returned: when AMI is created or already exists @@ -382,7 +382,7 @@ "snap-fbcccb8f", "snap-cfe7cdb4" ] -''' +""" import time diff --git a/plugins/modules/ec2_ami_info.py b/plugins/modules/ec2_ami_info.py index 773b351c1b1..516abd53804 100644 --- a/plugins/modules/ec2_ami_info.py +++ b/plugins/modules/ec2_ami_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_ami_info version_added: 1.0.0 @@ -47,12 +47,12 @@ type: bool extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: gather information about an AMI using ami-id @@ -74,9 +74,9 @@ owners: 099720109477 filters: name: "ubuntu/images/ubuntu-zesty-17.04-*" -''' +""" -RETURN = ''' +RETURN = r""" images: description: A list of images. returned: always @@ -195,7 +195,7 @@ returned: always type: str sample: hvm -''' +""" try: from botocore.exceptions import ClientError, BotoCoreError diff --git a/plugins/modules/ec2_eip.py b/plugins/modules/ec2_eip.py index 564e50eab2b..a253daf0e06 100644 --- a/plugins/modules/ec2_eip.py +++ b/plugins/modules/ec2_eip.py @@ -3,7 +3,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_eip version_added: 5.0.0 @@ -76,8 +76,8 @@ only applies to newly allocated Elastic IPs, isn't validated when I(reuse_existing_ip_allowed=true). type: str extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 @@ -92,9 +92,9 @@ It returns an overall status based on any changes occurring. It also returns individual changed statuses for disassociation and release. - Support for I(tags) and I(purge_tags) was added in release 2.1.0. -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: associate an elastic IP with an instance @@ -200,9 +200,9 @@ tag_name: reserved_for tag_value: "{{ inventory_hostname }}" public_ipv4_pool: ipv4pool-ec2-0588c9b75a25d1a02 -''' +""" -RETURN = ''' +RETURN = r""" allocation_id: description: allocation_id of the elastic ip returned: on success @@ -213,7 +213,7 @@ returned: on success type: str sample: 52.88.159.209 -''' +""" try: import botocore.exceptions diff --git a/plugins/modules/ec2_eip_info.py b/plugins/modules/ec2_eip_info.py index d5ad8e838f8..cdfa003b3a1 100644 --- a/plugins/modules/ec2_eip_info.py +++ b/plugins/modules/ec2_eip_info.py @@ -2,7 +2,7 @@ # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_eip_info version_added: 5.0.0 @@ -22,13 +22,12 @@ default: {} type: dict extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details or the AWS region, # see the AWS Guide for details. @@ -70,11 +69,10 @@ - ansible.builtin.set_fact: eip_alloc: my_vms_eips.addresses[0].allocation_id my_pub_ip: my_vms_eips.addresses[0].public_ip - -''' +""" -RETURN = ''' +RETURN = r""" addresses: description: Properties of all Elastic IP addresses matching the provided filters. Each element is a dict with all the information related to an EIP. returned: on success @@ -92,8 +90,7 @@ "Name": "test-vm-54.81.104.1" } }] - -''' +""" try: from botocore.exceptions import (BotoCoreError, ClientError) diff --git a/plugins/modules/ec2_eni.py b/plugins/modules/ec2_eni.py index c9c7fd2b853..4ddcf28eac1 100644 --- a/plugins/modules/ec2_eni.py +++ b/plugins/modules/ec2_eni.py @@ -2,7 +2,7 @@ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_eni version_added: 1.0.0 @@ -112,17 +112,17 @@ required: false type: str extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 notes: - This module identifies and ENI based on either the I(eni_id), a combination of I(private_ip_address) and I(subnet_id), or a combination of I(instance_id) and I(device_id). Any of these options will let you specify a particular ENI. - Support for I(tags) and I(purge_tags) was added in release 1.3.0. -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Create an ENI. As no security group is defined, ENI will be created in default security group @@ -206,11 +206,10 @@ - amazon.aws.ec2_eni: eni_id: "{{ eni.interface.id }}" delete_on_termination: true +""" -''' - -RETURN = ''' +RETURN = r""" interface: description: Network interface attributes returned: when state != absent @@ -270,8 +269,7 @@ description: which vpc this network interface is bound type: str sample: vpc-9a9a9da - -''' +""" import time from ipaddress import ip_address diff --git a/plugins/modules/ec2_eni_info.py b/plugins/modules/ec2_eni_info.py index c4254998867..bb38888a1f1 100644 --- a/plugins/modules/ec2_eni_info.py +++ b/plugins/modules/ec2_eni_info.py @@ -2,7 +2,7 @@ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_eni_info version_added: 1.0.0 @@ -26,12 +26,12 @@ type: dict default: {} extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all ENIs @@ -41,10 +41,9 @@ - amazon.aws.ec2_eni_info: filters: network-interface-id: eni-xxxxxxx +""" -''' - -RETURN = ''' +RETURN = r""" network_interfaces: description: List of matching elastic network interfaces. returned: always @@ -185,7 +184,7 @@ returned: always type: str sample: "vpc-b3f1f123" -''' +""" try: from botocore.exceptions import ClientError diff --git a/plugins/modules/ec2_instance.py b/plugins/modules/ec2_instance.py index f6dfcdcec39..4026869577b 100644 --- a/plugins/modules/ec2_instance.py +++ b/plugins/modules/ec2_instance.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: ec2_instance version_added: 1.0.0 @@ -370,13 +370,13 @@ default: 'disabled' extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Terminate every running instance in a region. Use with EXTREME caution. @@ -530,9 +530,9 @@ state: present tags: foo: bar -''' +""" -RETURN = ''' +RETURN = r""" instances: description: a list of ec2 instances returned: when wait == true @@ -938,7 +938,7 @@ returned: always type: dict sample: vpc-0011223344 -''' +""" from collections import namedtuple import time diff --git a/plugins/modules/ec2_instance_info.py b/plugins/modules/ec2_instance_info.py index 54760571b30..065af9c23b2 100644 --- a/plugins/modules/ec2_instance_info.py +++ b/plugins/modules/ec2_instance_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: ec2_instance_info version_added: 1.0.0 @@ -35,14 +35,13 @@ aliases: ['uptime'] type: int - extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all instances @@ -76,10 +75,9 @@ "tag:Name": "RHEL-*" instance-state-name: [ "running"] register: ec2_node_info +""" -''' - -RETURN = r''' +RETURN = r""" instances: description: A list of ec2 instances. returned: always @@ -500,7 +498,7 @@ returned: always type: dict sample: vpc-0011223344 -''' +""" import datetime diff --git a/plugins/modules/ec2_key.py b/plugins/modules/ec2_key.py index c411310d253..6b711a7ae5e 100644 --- a/plugins/modules/ec2_key.py +++ b/plugins/modules/ec2_key.py @@ -3,7 +3,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_key version_added: 1.0.0 @@ -49,17 +49,17 @@ notes: - Support for I(tags) and I(purge_tags) was added in release 2.1.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 author: - "Vincent Viallet (@zbal)" - "Prasad Katti (@prasadkatti)" -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: create a new EC2 key pair, returns generated private key @@ -93,9 +93,9 @@ amazon.aws.ec2_key: name: my_keypair state: absent -''' +""" -RETURN = ''' +RETURN = r""" changed: description: whether a keypair was created/deleted returned: always @@ -144,7 +144,7 @@ type: str sample: rsa version_added: 3.1.0 -''' +""" import uuid diff --git a/plugins/modules/ec2_metadata_facts.py b/plugins/modules/ec2_metadata_facts.py index 158e7515fbb..623b2134400 100644 --- a/plugins/modules/ec2_metadata_facts.py +++ b/plugins/modules/ec2_metadata_facts.py @@ -3,7 +3,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_metadata_facts version_added: 1.0.0 @@ -22,18 +22,18 @@ is set to disabled for the EC2 instance, the module will return an error while retrieving a session token. notes: - Parameters to filter on ec2_metadata_facts may be added later. -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Gather EC2 metadata facts - amazon.aws.ec2_metadata_facts: - debug: msg: "This instance is a t1.micro" when: ansible_ec2_instance_type == "t1.micro" -''' +""" -RETURN = ''' +RETURN = r""" ansible_facts: description: Dictionary of new facts representing discovered properties of the EC2 instance. returned: changed @@ -431,7 +431,7 @@ description: The instance user data. type: str sample: "#!/bin/bash" -''' +""" import json import re diff --git a/plugins/modules/ec2_security_group.py b/plugins/modules/ec2_security_group.py index c8bc251d9b2..b211d363529 100644 --- a/plugins/modules/ec2_security_group.py +++ b/plugins/modules/ec2_security_group.py @@ -270,8 +270,8 @@ type: bool extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 diff --git a/plugins/modules/ec2_security_group_info.py b/plugins/modules/ec2_security_group_info.py index 00b9d5da743..15c743b3451 100644 --- a/plugins/modules/ec2_security_group_info.py +++ b/plugins/modules/ec2_security_group_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_security_group_info version_added: 1.0.0 @@ -28,13 +28,12 @@ change. extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all security groups @@ -79,9 +78,9 @@ - amazon.aws.ec2_security_group_info: filters: "tag:Name": Example -''' +""" -RETURN = ''' +RETURN = r""" security_groups: description: Security groups that match the provided filters. Each element consists of a dict with all the information related to that security group. type: list @@ -244,7 +243,7 @@ "vpc_id": "vpc-0bc3bb03f97405435" } ] -''' +""" try: from botocore.exceptions import BotoCoreError, ClientError diff --git a/plugins/modules/ec2_snapshot.py b/plugins/modules/ec2_snapshot.py index 181c8a595e0..0baafb96ee2 100644 --- a/plugins/modules/ec2_snapshot.py +++ b/plugins/modules/ec2_snapshot.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_snapshot version_added: 1.0.0 @@ -70,12 +70,12 @@ type: int author: "Will Thames (@willthames)" extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" # Simple snapshot of volume using volume_id - amazon.aws.ec2_snapshot: volume_id: vol-abcdef12 @@ -104,9 +104,9 @@ - amazon.aws.ec2_snapshot: volume_id: vol-abcdef12 last_snapshot_min_age: 60 -''' +""" -RETURN = ''' +RETURN = r""" snapshot_id: description: The ID of the snapshot. Each snapshot receives a unique identifier when it is created. type: str @@ -127,7 +127,7 @@ type: int returned: always sample: 8 -''' +""" import datetime diff --git a/plugins/modules/ec2_snapshot_info.py b/plugins/modules/ec2_snapshot_info.py index e308d5390c0..5475f35ac89 100644 --- a/plugins/modules/ec2_snapshot_info.py +++ b/plugins/modules/ec2_snapshot_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: ec2_snapshot_info version_added: 1.0.0 @@ -66,12 +66,12 @@ the account use the filter 'owner-id'. extends_documentation_fragment: - - amazon.aws.ec2 - - amazon.aws.aws + - amazon.aws.region.modules + - amazon.aws.common.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all snapshots, including public ones @@ -106,10 +106,9 @@ - amazon.aws.ec2_snapshot_info: filters: status: error +""" -''' - -RETURN = r''' +RETURN = r""" snapshots: description: List of snapshots retrieved with their respective info. type: list @@ -199,7 +198,7 @@ - This value is null when there are no more results to return. type: str returned: when option C(max_results) is set in input -''' +""" try: from botocore.exceptions import ClientError diff --git a/plugins/modules/ec2_spot_instance.py b/plugins/modules/ec2_spot_instance.py index 9f7483f712d..fb974c68f52 100644 --- a/plugins/modules/ec2_spot_instance.py +++ b/plugins/modules/ec2_spot_instance.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_spot_instance version_added: 2.0.0 @@ -279,12 +279,12 @@ type: list elements: str extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Simple Spot Request Creation @@ -328,9 +328,9 @@ amazon.aws.ec2_spot_instance: spot_instance_request_ids: ['sir-12345678', 'sir-abcdefgh'] state: absent -''' +""" -RETURN = ''' +RETURN = r""" spot_request: description: The spot instance request details after creation returned: when success @@ -394,7 +394,8 @@ returned: always type: str sample: 'Spot requests with IDs: sir-1234abcd have been cancelled' -''' +""" + # TODO: add support for datetime-based parameters # import datetime # import time diff --git a/plugins/modules/ec2_spot_instance_info.py b/plugins/modules/ec2_spot_instance_info.py index 2860aa6198e..5cb34c19450 100644 --- a/plugins/modules/ec2_spot_instance_info.py +++ b/plugins/modules/ec2_spot_instance_info.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://wwww.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_spot_instance_info version_added: 2.0.0 @@ -29,12 +29,12 @@ default: [] extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: describe the Spot Instance requests based on request IDs @@ -56,10 +56,9 @@ filters: state: active launch.block-device-mapping.device-name: /dev/sdb +""" -''' - -RETURN = ''' +RETURN = r""" spot_request: description: The gathered information about specified spot instance requests. returned: when success @@ -233,8 +232,7 @@ "type": "one-time", "valid_until": "2021-09-08T21:05:57+00:00" } -''' - +""" try: import botocore diff --git a/plugins/modules/ec2_tag.py b/plugins/modules/ec2_tag.py index 4bdf515620a..1272f2517ae 100644 --- a/plugins/modules/ec2_tag.py +++ b/plugins/modules/ec2_tag.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_tag version_added: 1.0.0 @@ -44,12 +44,12 @@ - Lester Wade (@lwade) - Paul Arthur (@flowerysong) extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Ensure tags are present on a resource amazon.aws.ec2_tag: region: eu-west-1 @@ -93,9 +93,9 @@ Name: '' state: absent purge_tags: true -''' +""" -RETURN = ''' +RETURN = r""" tags: description: A dict containing the tags on the resource returned: always @@ -108,7 +108,7 @@ description: A dict of tags that were removed from the resource returned: If tags were removed type: dict -''' +""" from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule from ansible_collections.amazon.aws.plugins.module_utils.tagging import compare_aws_tags diff --git a/plugins/modules/ec2_tag_info.py b/plugins/modules/ec2_tag_info.py index 114d17aab24..99d50a41368 100644 --- a/plugins/modules/ec2_tag_info.py +++ b/plugins/modules/ec2_tag_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_tag_info version_added: 1.0.0 @@ -21,12 +21,12 @@ author: - Mark Chappell (@tremble) extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Retrieve all tags on an instance amazon.aws.ec2_tag_info: region: eu-west-1 @@ -38,14 +38,14 @@ region: eu-west-1 resource: vpc-xxxxxxxxxxxxxxxxx register: vpc_tags -''' +""" -RETURN = ''' +RETURN = r""" tags: description: A dict containing the tags on the resource returned: always type: dict -''' +""" from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule from ansible_collections.amazon.aws.plugins.module_utils.ec2 import describe_ec2_tags diff --git a/plugins/modules/ec2_vol.py b/plugins/modules/ec2_vol.py index 716c7de6218..dc7a38de566 100644 --- a/plugins/modules/ec2_vol.py +++ b/plugins/modules/ec2_vol.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_vol version_added: 1.0.0 @@ -108,13 +108,13 @@ notes: - Support for I(purge_tags) was added in release 1.5.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Simple attachment action - amazon.aws.ec2_vol: instance: XXXXXX @@ -200,9 +200,9 @@ id: XXXXXX device_name: /dev/sdf delete_on_termination: true -''' +""" -RETURN = ''' +RETURN = r""" device: description: device name of attached volume returned: when success @@ -243,7 +243,7 @@ "type": "standard", "zone": "us-east-1b" } -''' +""" import time diff --git a/plugins/modules/ec2_vol_info.py b/plugins/modules/ec2_vol_info.py index 2ef933fdee0..2d16c9bdd64 100644 --- a/plugins/modules/ec2_vol_info.py +++ b/plugins/modules/ec2_vol_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_vol_info version_added: 1.0.0 @@ -18,12 +18,12 @@ - A dict of filters to apply. Each dict item consists of a filter key and a filter value. - See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVolumes.html) for possible filters. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all volumes @@ -52,10 +52,9 @@ filters: attachment.instance-id: "i-000111222333" register: volumes +""" -''' - -RETURN = ''' +RETURN = r""" volumes: description: Volumes that match the provided filters. Each element consists of a dict with all the information related to that volume. type: list @@ -121,7 +120,7 @@ description: The throughput that the volume supports, in MiB/s. type: int sample: 131 -''' +""" try: from botocore.exceptions import ClientError diff --git a/plugins/modules/ec2_vpc_dhcp_option.py b/plugins/modules/ec2_vpc_dhcp_option.py index b3eef7fed23..bd77de205f7 100644 --- a/plugins/modules/ec2_vpc_dhcp_option.py +++ b/plugins/modules/ec2_vpc_dhcp_option.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_vpc_dhcp_option version_added: 1.0.0 @@ -87,13 +87,13 @@ notes: - Support for I(purge_tags) was added in release 2.0.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -RETURN = """ +RETURN = r""" changed: description: Whether the dhcp options were changed type: bool @@ -166,7 +166,7 @@ sample: 2 """ -EXAMPLES = """ +EXAMPLES = r""" # Completely overrides the VPC DHCP options associated with VPC vpc-123456 and deletes any existing # DHCP option set that may have been attached to that VPC. - amazon.aws.ec2_vpc_dhcp_option: @@ -226,7 +226,6 @@ region: us-east-1 dhcp_options_id: dopt-12345678 vpc_id: vpc-123456 - """ try: diff --git a/plugins/modules/ec2_vpc_dhcp_option_info.py b/plugins/modules/ec2_vpc_dhcp_option_info.py index a421b392bf3..bb6304e4dfb 100644 --- a/plugins/modules/ec2_vpc_dhcp_option_info.py +++ b/plugins/modules/ec2_vpc_dhcp_option_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_vpc_dhcp_option_info version_added: 1.0.0 @@ -29,12 +29,12 @@ type: bool default: false extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all DHCP Option sets for an account or profile @@ -57,10 +57,9 @@ profile: production dhcp_options_ids: dopt-123fece2 register: dhcp_info +""" -''' - -RETURN = ''' +RETURN = r""" dhcp_options: description: The DHCP options created, associated or found. returned: always @@ -146,7 +145,7 @@ description: True if listing the dhcp options succeeds. type: bool returned: always -''' +""" try: import botocore diff --git a/plugins/modules/ec2_vpc_endpoint.py b/plugins/modules/ec2_vpc_endpoint.py index 505f18d703e..17b3376184e 100644 --- a/plugins/modules/ec2_vpc_endpoint.py +++ b/plugins/modules/ec2_vpc_endpoint.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" module: ec2_vpc_endpoint short_description: Create and delete AWS VPC endpoints version_added: 1.0.0 @@ -107,13 +107,13 @@ - The C(policy_file) paramater was removed in release 6.0.0 please use the I(policy) option and a file lookup instead. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Create new vpc endpoint with a json template for policy @@ -144,9 +144,9 @@ state: absent vpc_endpoint_id: "{{ new_vpc_endpoint.result['VpcEndpointId'] }}" region: ap-southeast-2 -''' +""" -RETURN = r''' +RETURN = r""" endpoints: description: The resulting endpoints from the module call returned: success @@ -178,7 +178,7 @@ "vpc_id": "vpc-abbad0d0" } ] -''' +""" import datetime import json diff --git a/plugins/modules/ec2_vpc_endpoint_info.py b/plugins/modules/ec2_vpc_endpoint_info.py index fc1bf6159f9..d46a9588a5f 100644 --- a/plugins/modules/ec2_vpc_endpoint_info.py +++ b/plugins/modules/ec2_vpc_endpoint_info.py @@ -1,7 +1,7 @@ #!/usr/bin/python # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" module: ec2_vpc_endpoint_info short_description: Retrieves AWS VPC endpoints details using AWS methods version_added: 1.0.0 @@ -23,16 +23,16 @@ author: - Karen Cheng (@Etherdaemon) extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 notes: - Support for the C(query) parameter was dropped in release 6.0.0. This module now only queries for endpoints. Information about endpoint services can be retrieved using the M(amazon.aws.ec2_vpc_endpoint_service_info) module. -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Simple example of listing all support AWS services for VPC endpoints - name: Get all endpoints in ap-southeast-2 region amazon.aws.ec2_vpc_endpoint_info: @@ -57,9 +57,9 @@ vpc_endpoint_ids: - vpce-12345678 register: endpoint_details -''' +""" -RETURN = r''' +RETURN = r""" vpc_endpoints: description: - A list of matching endpoints. @@ -167,7 +167,7 @@ state: "available" vpc_endpoint_id: "vpce-abbad0d0" vpc_id: "vpc-1111ffff" -''' +""" try: import botocore diff --git a/plugins/modules/ec2_vpc_endpoint_service_info.py b/plugins/modules/ec2_vpc_endpoint_service_info.py index d649408508b..efeafd93003 100644 --- a/plugins/modules/ec2_vpc_endpoint_service_info.py +++ b/plugins/modules/ec2_vpc_endpoint_service_info.py @@ -1,7 +1,7 @@ #!/usr/bin/python # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" module: ec2_vpc_endpoint_service_info short_description: Retrieves AWS VPC endpoint service details version_added: 1.5.0 @@ -24,20 +24,20 @@ author: - Mark Chappell (@tremble) extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Simple example of listing all supported AWS services for VPC endpoints - name: List supported AWS endpoint services amazon.aws.ec2_vpc_endpoint_service_info: region: ap-southeast-2 register: supported_endpoint_services -''' +""" -RETURN = r''' +RETURN = r""" service_names: description: List of supported AWS VPC endpoint service names. returned: success @@ -106,7 +106,7 @@ - The verification state of the VPC endpoint service. - Consumers of an endpoint service cannot use the private name when the state is not C(verified). type: str -''' +""" try: import botocore diff --git a/plugins/modules/ec2_vpc_igw.py b/plugins/modules/ec2_vpc_igw.py index aed9f0e8bf3..628fbdd6918 100644 --- a/plugins/modules/ec2_vpc_igw.py +++ b/plugins/modules/ec2_vpc_igw.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_vpc_igw version_added: 1.0.0 @@ -25,13 +25,13 @@ notes: - Support for I(purge_tags) was added in release 1.3.0. extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.tags -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.tags + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Ensure that the VPC has an Internet Gateway. @@ -56,9 +56,9 @@ state: absent vpc_id: vpc-abcdefgh register: vpc_igw_delete -''' +""" -RETURN = ''' +RETURN = r""" changed: description: If any changes have been made to the Internet Gateway. type: bool @@ -84,7 +84,7 @@ returned: I(state=present) sample: vpc_id: "vpc-XXXXXXXX" -''' +""" try: import botocore diff --git a/plugins/modules/ec2_vpc_igw_info.py b/plugins/modules/ec2_vpc_igw_info.py index 3f38e2c3a38..a03d8c202ea 100644 --- a/plugins/modules/ec2_vpc_igw_info.py +++ b/plugins/modules/ec2_vpc_igw_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: ec2_vpc_igw_info version_added: 1.0.0 @@ -30,12 +30,12 @@ type: bool version_added: 1.3.0 extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = r''' +EXAMPLES = r""" # # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all Internet Gateways for an account or profile @@ -58,9 +58,9 @@ profile: production internet_gateway_ids: igw-c1231234 register: igw_info -''' +""" -RETURN = r''' +RETURN = r""" changed: description: True if listing the internet gateways succeeds. type: bool @@ -98,7 +98,7 @@ sample: tags: "Ansible": "Test" -''' +""" try: import botocore diff --git a/plugins/modules/ec2_vpc_nat_gateway.py b/plugins/modules/ec2_vpc_nat_gateway.py index d60279a303f..45f9b0446d8 100644 --- a/plugins/modules/ec2_vpc_nat_gateway.py +++ b/plugins/modules/ec2_vpc_nat_gateway.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: ec2_vpc_nat_gateway version_added: 1.0.0 @@ -81,13 +81,13 @@ notes: - Support for I(tags) and I(purge_tags) was added in release 1.4.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Create new nat gateway with client token. @@ -182,9 +182,9 @@ Tag3: tag3 wait: true register: update_tags_nat_gateway -''' +""" -RETURN = r''' +RETURN = r""" create_time: description: The ISO 8601 date time format in UTC. returned: In all cases. @@ -229,7 +229,7 @@ 'allocation_id': 'eipalloc-12345' } ] -''' +""" import datetime diff --git a/plugins/modules/ec2_vpc_nat_gateway_info.py b/plugins/modules/ec2_vpc_nat_gateway_info.py index e2b2a2e84dc..4419f7d2ff2 100644 --- a/plugins/modules/ec2_vpc_nat_gateway_info.py +++ b/plugins/modules/ec2_vpc_nat_gateway_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" module: ec2_vpc_nat_gateway_info short_description: Retrieves AWS VPC Managed Nat Gateway details using AWS methods version_added: 1.0.0 @@ -24,12 +24,12 @@ default: {} author: Karen Cheng (@Etherdaemon) extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = r''' +EXAMPLES = r""" # Simple example of listing all nat gateways - name: List all managed nat gateways in ap-southeast-2 amazon.aws.ec2_vpc_nat_gateway_info: @@ -62,9 +62,9 @@ subnet-id: subnet-12345678 state: ['available'] register: existing_nat_gateways -''' +""" -RETURN = r''' +RETURN = r""" changed: description: True if listing the internet gateways succeeds. type: bool @@ -139,7 +139,7 @@ sample: Tag1: tag1 Tag_2: tag_2 -''' +""" try: diff --git a/plugins/modules/ec2_vpc_net.py b/plugins/modules/ec2_vpc_net.py index 6db8f843e6a..5851bfd7cbb 100644 --- a/plugins/modules/ec2_vpc_net.py +++ b/plugins/modules/ec2_vpc_net.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_vpc_net version_added: 1.0.0 @@ -82,13 +82,13 @@ type: bool default: false extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: create a VPC with dedicated tenancy and a couple of tags @@ -108,9 +108,9 @@ ipv6_cidr: True region: us-east-1 tenancy: dedicated -''' +""" -RETURN = ''' +RETURN = r""" vpc: description: info about the VPC that was created or deleted returned: always @@ -200,7 +200,7 @@ returned: always type: str sample: 123456789012 -''' +""" from time import sleep from time import time diff --git a/plugins/modules/ec2_vpc_net_info.py b/plugins/modules/ec2_vpc_net_info.py index 0f75d4fba95..3a831e7b7e3 100644 --- a/plugins/modules/ec2_vpc_net_info.py +++ b/plugins/modules/ec2_vpc_net_info.py @@ -2,7 +2,7 @@ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_vpc_net_info version_added: 1.0.0 @@ -24,12 +24,12 @@ type: dict default: {} extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all VPCs @@ -43,10 +43,9 @@ - amazon.aws.ec2_vpc_net_info: filters: "tag:Name": Example +""" -''' - -RETURN = ''' +RETURN = r""" vpcs: description: Returns an array of complex objects as described below. returned: success @@ -150,7 +149,7 @@ returned: always type: str sample: dopt-12345678 -''' +""" try: import botocore diff --git a/plugins/modules/ec2_vpc_route_table.py b/plugins/modules/ec2_vpc_route_table.py index 4246d2f3a0f..1b7a58c26fa 100644 --- a/plugins/modules/ec2_vpc_route_table.py +++ b/plugins/modules/ec2_vpc_route_table.py @@ -2,7 +2,7 @@ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: ec2_vpc_route_table version_added: 1.0.0 @@ -81,13 +81,13 @@ notes: - Tags are used to uniquely identify route tables within a VPC when the I(route_table_id) is not supplied. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Basic creation example: @@ -151,9 +151,9 @@ route_table_id: "{{ route_table.id }}" lookup: id state: absent -''' +""" -RETURN = r''' +RETURN = r""" route_table: description: Route Table result. returned: always @@ -276,7 +276,7 @@ returned: always type: str sample: vpc-6e2d2407 -''' +""" import re from time import sleep diff --git a/plugins/modules/ec2_vpc_route_table_info.py b/plugins/modules/ec2_vpc_route_table_info.py index 98f6ae6e053..4838edf3f01 100644 --- a/plugins/modules/ec2_vpc_route_table_info.py +++ b/plugins/modules/ec2_vpc_route_table_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: ec2_vpc_route_table_info version_added: 1.0.0 @@ -19,12 +19,12 @@ See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeRouteTables.html) for possible filters. type: dict extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all VPC route tables @@ -44,9 +44,9 @@ amazon.aws.ec2_vpc_route_table_info: filters: vpc-id: vpc-abcdef00 -''' +""" -RETURN = r''' +RETURN = r""" route_tables: description: - A list of dictionarys describing route tables. @@ -182,7 +182,7 @@ returned: always type: str sample: vpc-6e2d2407 -''' +""" try: import botocore diff --git a/plugins/modules/ec2_vpc_subnet.py b/plugins/modules/ec2_vpc_subnet.py index 6a9ea9304cf..ca65fe6141e 100644 --- a/plugins/modules/ec2_vpc_subnet.py +++ b/plugins/modules/ec2_vpc_subnet.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_vpc_subnet version_added: 1.0.0 @@ -73,13 +73,13 @@ tags: default: {} extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Create subnet for database servers @@ -110,9 +110,9 @@ vpc_id: vpc-123456 cidr: 10.1.100.0/24 ipv6_cidr: '' -''' +""" -RETURN = ''' +RETURN = r""" subnet: description: Dictionary of subnet values returned: I(state=present) @@ -200,7 +200,7 @@ description: The CIDR block association state. returned: always type: str -''' +""" import time diff --git a/plugins/modules/ec2_vpc_subnet_info.py b/plugins/modules/ec2_vpc_subnet_info.py index f87bc6a8b1f..b931555918d 100644 --- a/plugins/modules/ec2_vpc_subnet_info.py +++ b/plugins/modules/ec2_vpc_subnet_info.py @@ -2,7 +2,7 @@ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: ec2_vpc_subnet_info version_added: 1.0.0 @@ -25,12 +25,12 @@ type: dict default: {} extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 -''' + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -EXAMPLES = ''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all VPC subnets @@ -66,9 +66,9 @@ - set_fact: subnet_ids: "{{ subnet_info.results | sum(attribute='subnets', start=[]) | map(attribute='subnet_id') }}" -''' +""" -RETURN = ''' +RETURN = r""" subnets: description: Returns an array of complex objects as described below. returned: success @@ -140,7 +140,7 @@ description: The CIDR block association state. returned: always type: str -''' +""" try: import botocore diff --git a/plugins/modules/elb_application_lb.py b/plugins/modules/elb_application_lb.py index 8cd9b211326..ffa2db034bc 100644 --- a/plugins/modules/elb_application_lb.py +++ b/plugins/modules/elb_application_lb.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: elb_application_lb version_added: 5.0.0 @@ -216,17 +216,17 @@ version_added: 3.2.0 version_added_collection: community.aws extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 notes: - Listeners are matched based on port. If a listener's port is changed then a new listener will be created. - Listener rules are matched based on priority. If a rule's priority is changed then a new rule will be created. -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Create an ALB and attach a listener @@ -341,10 +341,9 @@ - amazon.aws.elb_application_lb: name: myalb state: absent +""" -''' - -RETURN = r''' +RETURN = r""" access_logs_s3_bucket: description: The name of the S3 bucket for the access logs. returned: when state is present @@ -527,7 +526,8 @@ returned: when state is present type: bool sample: false -''' +""" + try: import botocore except ImportError: diff --git a/plugins/modules/elb_application_lb_info.py b/plugins/modules/elb_application_lb_info.py index 11a49487245..46fd5a06f16 100644 --- a/plugins/modules/elb_application_lb_info.py +++ b/plugins/modules/elb_application_lb_info.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: elb_application_lb_info version_added: 5.0.0 @@ -28,13 +28,12 @@ elements: str extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all ALBs @@ -58,9 +57,9 @@ register: alb_info - ansible.builtin.debug: var: alb_info -''' +""" -RETURN = r''' +RETURN = r""" load_balancers: description: a list of load balancers returned: always @@ -209,7 +208,7 @@ if it is unable to forward the request to AWS WAF. type: bool sample: false -''' +""" try: import botocore diff --git a/plugins/modules/elb_classic_lb.py b/plugins/modules/elb_classic_lb.py index 885ca0bbf90..297c6abe03b 100644 --- a/plugins/modules/elb_classic_lb.py +++ b/plugins/modules/elb_classic_lb.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: elb_classic_lb version_added: 1.0.0 @@ -279,13 +279,13 @@ - Support for I(purge_tags) was added in release 2.1.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = """ +EXAMPLES = r""" # Note: None of these examples set aws_access_key, aws_secret_key, or region. # It is assumed that their matching environment variables are set. @@ -487,7 +487,7 @@ tags: {} """ -RETURN = ''' +RETURN = r""" elb: description: Load Balancer attributes returned: always @@ -667,7 +667,7 @@ elements: str sample: ['us-east-1b', 'us-east-1a'] returned: when state is not 'absent' -''' +""" try: import botocore diff --git a/plugins/modules/iam_policy.py b/plugins/modules/iam_policy.py index 60c709d395d..efc6985cc36 100644 --- a/plugins/modules/iam_policy.py +++ b/plugins/modules/iam_policy.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: iam_policy version_added: 5.0.0 @@ -50,12 +50,12 @@ - "Jonathan I. Davila (@defionscode)" - "Dennis Podkovyrin (@sbj-ss)" extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" # Advanced example, create two new groups and add a READ-ONLY policy to both # groups. - name: Create Two Groups, Mario and Luigi @@ -87,15 +87,15 @@ loop: - user: s3_user prefix: s3_user_prefix +""" -''' -RETURN = ''' +RETURN = r""" policy_names: description: A list of names of the inline policies embedded in the specified IAM resource (user, group, or role). returned: always type: list elements: str -''' +""" import json diff --git a/plugins/modules/iam_policy_info.py b/plugins/modules/iam_policy_info.py index f060ecf9ed4..e4b76646c06 100644 --- a/plugins/modules/iam_policy_info.py +++ b/plugins/modules/iam_policy_info.py @@ -3,7 +3,7 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: iam_policy_info version_added: 5.0.0 @@ -31,13 +31,12 @@ author: - Mark Chappell (@tremble) extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" - name: Describe all inline IAM policies on an IAM User amazon.aws.iam_policy_info: iam_type: user @@ -48,9 +47,9 @@ iam_type: role iam_name: example_role policy_name: example_policy +""" -''' -RETURN = ''' +RETURN = r""" policies: description: A list containing the matching IAM inline policy names and their data returned: success @@ -72,7 +71,7 @@ description: A list of names of all of the IAM inline policies on the queried object returned: success type: list -''' +""" try: import botocore diff --git a/plugins/modules/iam_user.py b/plugins/modules/iam_user.py index 3c73de2998b..3b029ea89ad 100644 --- a/plugins/modules/iam_user.py +++ b/plugins/modules/iam_user.py @@ -2,7 +2,7 @@ # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: iam_user version_added: 5.0.0 @@ -91,13 +91,13 @@ notes: - Support for I(tags) and I(purge_tags) was added in release 2.1.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Note: This module does not allow management of groups that users belong to. # Groups should manage their membership directly using community.aws.iam_group, @@ -138,9 +138,9 @@ amazon.aws.iam_user: name: testuser1 state: absent +""" -''' -RETURN = r''' +RETURN = r""" user: description: dictionary containing all the user information returned: success @@ -171,7 +171,7 @@ type: dict returned: always sample: {"Env": "Prod"} -''' +""" try: import botocore diff --git a/plugins/modules/iam_user_info.py b/plugins/modules/iam_user_info.py index 7f96c65dce8..b44ee99f683 100644 --- a/plugins/modules/iam_user_info.py +++ b/plugins/modules/iam_user_info.py @@ -4,7 +4,7 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: iam_user_info version_added: 5.0.0 @@ -34,13 +34,12 @@ default: '/' type: str extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather facts about "test" user. - name: Get IAM user info @@ -56,9 +55,9 @@ - name: Get IAM user info amazon.aws.iam_user_info: path: "/division_abc/subdivision_xyz/" -''' +""" -RETURN = r''' +RETURN = r""" iam_users: description: list of maching iam users returned: success @@ -99,7 +98,7 @@ type: dict returned: if user exists sample: '{"Env": "Prod"}' -''' +""" try: from botocore.exceptions import BotoCoreError, ClientError diff --git a/plugins/modules/kms_key.py b/plugins/modules/kms_key.py index ad79f1e078d..3d7f7dfff1a 100644 --- a/plugins/modules/kms_key.py +++ b/plugins/modules/kms_key.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -* # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: kms_key version_added: 5.0.0 @@ -144,8 +144,8 @@ - Will Thames (@willthames) - Mark Chappell (@tremble) extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 @@ -154,9 +154,9 @@ This can cause issues when running duplicate tasks in succession or using the M(amazon.aws.kms_key_info) module to fetch key metadata shortly after modifying keys. For this reason, it is recommended to use the return data from this module (M(amazon.aws.kms_key)) to fetch a key's metadata. -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Create a new KMS key - amazon.aws.kms_key: alias: mykey @@ -207,9 +207,9 @@ alias: my-kms-key policy: "{{ lookup('template', 'kms_iam_policy_template.json.j2') }}" state: present -''' +""" -RETURN = r''' +RETURN = r""" key_id: description: ID of key. type: str @@ -431,9 +431,7 @@ version_added: 5.2.0 returned: always sample: False - - -''' +""" # these mappings are used to go from simple labels to the actual 'Sid' values returned # by get_policy. They seem to be magic values. diff --git a/plugins/modules/kms_key_info.py b/plugins/modules/kms_key_info.py index f16598e76e4..169878c6f7e 100644 --- a/plugins/modules/kms_key_info.py +++ b/plugins/modules/kms_key_info.py @@ -2,7 +2,7 @@ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: kms_key_info version_added: 5.0.0 @@ -48,12 +48,12 @@ default: False type: bool extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all KMS keys @@ -68,9 +68,9 @@ - amazon.aws.kms_key_info: filters: "tag:Name": Example -''' +""" -RETURN = r''' +RETURN = r""" kms_keys: description: List of keys. type: complex @@ -280,7 +280,7 @@ type: str returned: always sample: arn:aws:sts::123456789012:assumed-role/lambda_xyz/xyz -''' +""" import json diff --git a/plugins/modules/lambda.py b/plugins/modules/lambda.py index 7104cb5ac9d..5218825ffaf 100644 --- a/plugins/modules/lambda.py +++ b/plugins/modules/lambda.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: lambda version_added: 5.0.0 @@ -143,13 +143,13 @@ author: - 'Steyn Huizinga (@steynovich)' extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Create Lambda functions - name: looped creation amazon.aws.lambda: @@ -211,9 +211,9 @@ handler: 'hello_python.my_handler' layers: - layer_version_arn: 'arn:aws:lambda:us-east-1:123456789012:layer:python27-env:7' -''' +""" -RETURN = r''' +RETURN = r""" code: description: The lambda function's code returned by get_function in boto3. returned: success @@ -383,7 +383,7 @@ description: The Amazon Resource Name (ARN) of a signing job. returned: always type: str -''' +""" import base64 import hashlib diff --git a/plugins/modules/lambda_alias.py b/plugins/modules/lambda_alias.py index 7dcb6707a3d..14d91f6a4f8 100644 --- a/plugins/modules/lambda_alias.py +++ b/plugins/modules/lambda_alias.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: lambda_alias version_added: 5.0.0 @@ -46,13 +46,12 @@ type: int default: 0 extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" --- # Simple example to create a lambda function and publish a version - hosts: localhost @@ -113,9 +112,9 @@ name: Prod version: "{{ production_version }}" description: "Production is version {{ production_version }}" -''' +""" -RETURN = ''' +RETURN = r""" --- alias_arn: description: Full ARN of the function, including the alias @@ -142,7 +141,7 @@ returned: success type: str sample: 12345678-1234-1234-1234-123456789abc -''' +""" import re diff --git a/plugins/modules/lambda_event.py b/plugins/modules/lambda_event.py index a2b34e8c09e..81a31aee285 100644 --- a/plugins/modules/lambda_event.py +++ b/plugins/modules/lambda_event.py @@ -2,7 +2,7 @@ # (c) 2016, Pierre Jodouin # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: lambda_event version_added: 5.0.0 @@ -85,13 +85,12 @@ required: true type: dict extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" # Example that creates a lambda event notification for a DynamoDB stream - name: DynamoDB stream event mapping amazon.aws.lambda_event: @@ -124,15 +123,15 @@ - name: Show source event ansible.builtin.debug: var: event.lambda_stream_events -''' +""" -RETURN = ''' +RETURN = r""" --- lambda_stream_events: description: list of dictionaries returned by the API describing stream event mappings returned: success type: list -''' +""" import re diff --git a/plugins/modules/lambda_execute.py b/plugins/modules/lambda_execute.py index 3943b06bced..6ea1367e40b 100644 --- a/plugins/modules/lambda_execute.py +++ b/plugins/modules/lambda_execute.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: lambda_execute version_added: 5.0.0 @@ -14,8 +14,8 @@ The usage did not change. - This module was originally added to C(community.aws) in release 1.0.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 author: - "Ryan Scott Brown (@ryansb) " @@ -69,9 +69,9 @@ - A dictionary in any form to be provided as input to the Lambda function. default: {} type: dict -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" - amazon.aws.lambda_execute: name: test-function # the payload is automatically serialized and sent to the function @@ -105,9 +105,9 @@ - amazon.aws.lambda_execute: name: test-function version_qualifier: PRODUCTION -''' +""" -RETURN = ''' +RETURN = r""" result: description: Resulting data structure from a successful task execution. returned: success @@ -127,7 +127,7 @@ type: int sample: 200 returned: always -''' +""" import base64 import json diff --git a/plugins/modules/lambda_info.py b/plugins/modules/lambda_info.py index d26faa9169d..3842850b7b6 100644 --- a/plugins/modules/lambda_info.py +++ b/plugins/modules/lambda_info.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: lambda_info version_added: 5.0.0 @@ -32,12 +32,12 @@ author: - Pierre Jodouin (@pjodouin) extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" --- # Simple example of listing all info for a function - name: List all for a specific function @@ -62,9 +62,9 @@ - name: show Lambda information ansible.builtin.debug: msg: "{{ output['function'] }}" -''' +""" -RETURN = ''' +RETURN = r""" --- function: description: @@ -263,7 +263,8 @@ 'subnet_ids': [], 'vpc_id': '123' } -''' +""" + import json import re diff --git a/plugins/modules/lambda_layer.py b/plugins/modules/lambda_layer.py index c25b6286f94..1e116d54f60 100644 --- a/plugins/modules/lambda_layer.py +++ b/plugins/modules/lambda_layer.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: lambda_layer version_added: 5.1.0 @@ -89,13 +89,12 @@ I(license_info), I(compatible_architectures). type: int extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" --- # Create a new Python library layer version from a zip archive located into a S3 bucket - name: Create a new python library layer @@ -141,9 +140,9 @@ state: absent name: test-layer version: -1 -''' +""" -RETURN = ''' +RETURN = r""" layer_version: description: info about the layer version that was created or deleted. returned: always @@ -216,7 +215,7 @@ description: A list of compatible instruction set architectures. returned: if it was defined for the layer version. type: list -''' +""" try: import botocore diff --git a/plugins/modules/lambda_layer_info.py b/plugins/modules/lambda_layer_info.py index 9fe7f87b381..cdb59bc49de 100644 --- a/plugins/modules/lambda_layer_info.py +++ b/plugins/modules/lambda_layer_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: lambda_layer_info version_added: 5.1.0 @@ -43,13 +43,12 @@ - Specify this option with I(name) to include only layer versions that are compatible with that architecture. type: str extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.aws.boto3 + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" --- # Display information about the versions for the layer named blank-java-lib - name: Retrieve layer versions @@ -76,9 +75,9 @@ amazon.aws.lambda_layer_info: name: my-layer version_number: 1 -''' +""" -RETURN = ''' +RETURN = r""" layers_versions: description: - The layers versions that exists. @@ -148,7 +147,7 @@ signing_job_arn: description: The Amazon Resource Name (ARN) of a signing job. type: str -''' +""" try: import botocore diff --git a/plugins/modules/lambda_policy.py b/plugins/modules/lambda_policy.py index e1e7a210ff4..bb2dbe89fec 100644 --- a/plugins/modules/lambda_policy.py +++ b/plugins/modules/lambda_policy.py @@ -3,7 +3,7 @@ # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: lambda_policy version_added: 5.0.0 @@ -93,13 +93,12 @@ type: str extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" - name: Lambda S3 event notification amazon.aws.lambda_policy: @@ -116,15 +115,15 @@ - name: show results ansible.builtin.debug: var: lambda_policy_action -''' +""" -RETURN = ''' +RETURN = r""" --- lambda_policy_action: description: describes what action was taken returned: success type: str -''' +""" import json import re diff --git a/plugins/modules/rds_cluster.py b/plugins/modules/rds_cluster.py index d13fb0a41e5..24c03e9cd9b 100644 --- a/plugins/modules/rds_cluster.py +++ b/plugins/modules/rds_cluster.py @@ -3,7 +3,7 @@ # Copyright (c) 2022 Alina Buzachis (@alinabuzachis) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: rds_cluster version_added: 5.0.0 @@ -12,8 +12,8 @@ - Create, modify, and delete RDS clusters. - This module was originally added to C(community.aws) in release 3.2.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 author: @@ -212,7 +212,7 @@ master_user_password: description: - An 8-41 character password for the master database user. - - The password can contain any printable ASCII character except "/", """, or "@". + - The password can contain any printable ASCII character except C(/), C("), or C(@). - To modify the password use I(force_password_update). Use I(apply immediately) to change the password immediately, otherwise it is updated during the next maintenance window. aliases: @@ -345,9 +345,9 @@ - A list of EC2 VPC security groups to associate with the DB cluster. type: list elements: str -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Create minimal aurora cluster in default VPC and default subnet group amazon.aws.rds_cluster: @@ -417,9 +417,9 @@ engine: aurora-postgresql state: present db_instance_class: 'db.t3.medium' -''' +""" -RETURN = r''' +RETURN = r""" activity_stream_status: description: The status of the database activity stream. returned: always @@ -644,7 +644,7 @@ returned: always type: str sample: sg-12345678 -''' +""" try: diff --git a/plugins/modules/rds_cluster_info.py b/plugins/modules/rds_cluster_info.py index 5d8622e6e65..db265b393e4 100644 --- a/plugins/modules/rds_cluster_info.py +++ b/plugins/modules/rds_cluster_info.py @@ -3,7 +3,7 @@ # Copyright (c) 2022 Alina Buzachis (@alinabuzachis) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" module: rds_cluster_info version_added: 5.0.0 short_description: Obtain information about one or more RDS clusters @@ -28,13 +28,12 @@ author: - Alina Buzachis (@alinabuzachis) extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = r''' +EXAMPLES = r""" - name: Get info of all existing DB clusters amazon.aws.rds_cluster_info: register: _result_cluster_info @@ -48,9 +47,9 @@ amazon.aws.rds_cluster_info: engine: "aurora" register: _result_cluster_info -''' +""" -RETURN = r''' +RETURN = r""" clusters: description: List of RDS clusters. returned: always @@ -236,7 +235,7 @@ description: Security group of the cluster. type: str sample: sg-12345678 -''' +""" try: diff --git a/plugins/modules/rds_cluster_snapshot.py b/plugins/modules/rds_cluster_snapshot.py index 187f8f33274..d03f129ae1f 100644 --- a/plugins/modules/rds_cluster_snapshot.py +++ b/plugins/modules/rds_cluster_snapshot.py @@ -3,7 +3,7 @@ # Copyright (c) 2021 Alina Buzachis (@alinabuzachis) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: rds_cluster_snapshot version_added: 5.0.0 @@ -69,13 +69,13 @@ author: - Alina Buzachis (@alinabuzachis) extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" - name: Create a DB cluster snapshot amazon.aws.rds_cluster_snapshot: db_cluster_identifier: "{{ cluster_id }}" @@ -93,9 +93,9 @@ source_id: "{{ snapshot.db_snapshot_arn }}" source_region: us-east-2 copy_tags: true -''' +""" -RETURN = r''' +RETURN = r""" availability_zone: description: Availability zone of the database from which the snapshot was created. returned: always @@ -210,7 +210,7 @@ returned: always type: complex contains: {} -''' +""" try: import botocore diff --git a/plugins/modules/rds_instance.py b/plugins/modules/rds_instance.py index e6fe36260d7..b48a506bae3 100644 --- a/plugins/modules/rds_instance.py +++ b/plugins/modules/rds_instance.py @@ -2,7 +2,7 @@ # Copyright (c) 2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: rds_instance version_added: 5.0.0 @@ -11,8 +11,8 @@ - Create, modify, and delete RDS instances. - This module was originally added to C(community.aws) in release 1.0.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 author: @@ -248,7 +248,7 @@ master_user_password: description: - An 8-41 character password for the master database user. The password can contain any printable ASCII character - except "/", """, or "@". To modify the password use I(force_update_password). Use I(apply immediately) to change + except C(/), C("), or C(@). To modify the password use I(force_update_password). Use I(apply immediately) to change the password immediately, otherwise it is updated during the next maintenance window. aliases: - password @@ -451,9 +451,9 @@ default: True version_added: 1.5.0 version_added_collection: community.aws -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: create minimal aurora instance in default VPC and default subnet group amazon.aws.rds_instance: @@ -549,9 +549,9 @@ engine: mariadb state: present register: restored_db -''' +""" -RETURN = r''' +RETURN = r""" allocated_storage: description: The allocated storage size in gigabytes. This is always 1 for aurora database engines. returned: always @@ -853,7 +853,7 @@ returned: always type: str sample: sg-12345678 -''' +""" from time import sleep diff --git a/plugins/modules/rds_instance_info.py b/plugins/modules/rds_instance_info.py index 00bac28832f..831466cd9fc 100644 --- a/plugins/modules/rds_instance_info.py +++ b/plugins/modules/rds_instance_info.py @@ -4,7 +4,7 @@ # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: rds_instance_info version_added: 5.0.0 @@ -29,13 +29,12 @@ - "Will Thames (@willthames)" - "Michael De La Rue (@mikedlr)" extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" - name: Get information about an instance amazon.aws.rds_instance_info: db_instance_identifier: new-database @@ -43,9 +42,9 @@ - name: Get all RDS instances amazon.aws.rds_instance_info: -''' +""" -RETURN = ''' +RETURN = r""" instances: description: List of RDS instances returned: always @@ -348,7 +347,7 @@ returned: always type: str sample: sg-abcd1234 -''' +""" from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule from ansible_collections.amazon.aws.plugins.module_utils.botocore import is_boto3_error_code diff --git a/plugins/modules/rds_instance_snapshot.py b/plugins/modules/rds_instance_snapshot.py index dec461924c9..9d45b678e5d 100644 --- a/plugins/modules/rds_instance_snapshot.py +++ b/plugins/modules/rds_instance_snapshot.py @@ -4,7 +4,7 @@ # Copyright (c) 2017, 2018 Michael De La Rue # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: rds_instance_snapshot version_added: 5.0.0 @@ -74,13 +74,13 @@ - "Alina Buzachis (@alinabuzachis)" - "Joseph Torcasso (@jatorcasso)" extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" - name: Create snapshot amazon.aws.rds_instance_snapshot: db_instance_identifier: new-database @@ -99,9 +99,9 @@ amazon.aws.rds_instance_snapshot: db_snapshot_identifier: new-database-snapshot state: absent -''' +""" -RETURN = r''' +RETURN = r""" allocated_storage: description: How much storage is allocated in GB. returned: always @@ -224,7 +224,7 @@ returned: always type: str sample: vpc-09ff232e222710ae0 -''' +""" try: import botocore diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index a79ad09caab..dffb6d70c28 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" module: rds_option_group short_description: Manages the creation, modification, deletion of RDS option groups version_added: 5.0.0 @@ -120,13 +120,13 @@ type: bool default: True extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Create an RDS Mysql Option group - name: Create an RDS Mysql option group amazon.aws.rds_option_group: @@ -178,9 +178,9 @@ state: absent option_group_name: test-mysql-option-group register: deleted_rds_mysql_option_group -''' +""" -RETURN = r''' +RETURN = r""" allows_vpc_and_non_vpc_instance_memberships: description: Indicates whether this option group can be applied to both VPC and non-VPC instances. returned: always @@ -341,7 +341,7 @@ sample: { "Ansible": "Test" } -''' +""" from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule diff --git a/plugins/modules/rds_option_group_info.py b/plugins/modules/rds_option_group_info.py index 80e57a621d1..59d9efdbe9f 100644 --- a/plugins/modules/rds_option_group_info.py +++ b/plugins/modules/rds_option_group_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: rds_option_group_info short_description: rds_option_group_info module @@ -44,12 +44,12 @@ default: '' required: false extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: List an option group @@ -62,9 +62,9 @@ region: ap-southeast-2 profile: production register: option_group -''' +""" -RETURN = r''' +RETURN = r""" changed: description: True if listing the RDS option group succeeds. type: bool @@ -231,7 +231,7 @@ "Ansible": "Test" } -''' +""" try: import botocore diff --git a/plugins/modules/rds_param_group.py b/plugins/modules/rds_param_group.py index 7725b8c60a9..69d819a58d4 100644 --- a/plugins/modules/rds_param_group.py +++ b/plugins/modules/rds_param_group.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: rds_param_group version_added: 5.0.0 @@ -51,14 +51,13 @@ - "Scott Anderson (@tastychutney)" - "Will Thames (@willthames)" extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" - name: Add or change a parameter group, in this case setting auto_increment_increment to 42 * 1024 amazon.aws.rds_param_group: state: present @@ -75,9 +74,9 @@ amazon.aws.rds_param_group: state: absent name: norwegian-blue -''' +""" -RETURN = ''' +RETURN = r""" db_parameter_group_name: description: Name of DB parameter group type: str @@ -102,7 +101,7 @@ description: dictionary of tags type: dict returned: when state is present -''' +""" try: import botocore diff --git a/plugins/modules/rds_snapshot_info.py b/plugins/modules/rds_snapshot_info.py index 567e5e3e60a..ffc15bceb37 100644 --- a/plugins/modules/rds_snapshot_info.py +++ b/plugins/modules/rds_snapshot_info.py @@ -4,7 +4,7 @@ # Copyright (c) 2017, 2018 Michael De La Rue # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: rds_snapshot_info version_added: 5.0.0 @@ -50,13 +50,12 @@ author: - "Will Thames (@willthames)" extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = ''' +EXAMPLES = r""" - name: Get information about an snapshot amazon.aws.rds_snapshot_info: db_snapshot_identifier: snapshot_name @@ -65,9 +64,9 @@ - name: Get all RDS snapshots for an RDS instance amazon.aws.rds_snapshot_info: db_instance_identifier: helloworld-rds-master -''' +""" -RETURN = ''' +RETURN = r""" snapshots: description: List of non-clustered snapshots returned: When cluster parameters are not passed @@ -285,7 +284,7 @@ returned: always type: str sample: vpc-abcd1234 -''' +""" from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule from ansible_collections.amazon.aws.plugins.module_utils.botocore import is_boto3_error_code diff --git a/plugins/modules/rds_subnet_group.py b/plugins/modules/rds_subnet_group.py index 97e20df1d10..6f87778eaf3 100644 --- a/plugins/modules/rds_subnet_group.py +++ b/plugins/modules/rds_subnet_group.py @@ -3,7 +3,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: rds_subnet_group version_added: 5.0.0 @@ -40,14 +40,13 @@ - "Scott Anderson (@tastychutney)" - "Alina Buzachis (@alinabuzachis)" extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 +""" -''' - -EXAMPLES = r''' +EXAMPLES = r""" - name: Add or change a subnet group amazon.aws.rds_subnet_group: state: present @@ -73,9 +72,9 @@ amazon.aws.rds_subnet_group: state: absent name: norwegian-blue -''' +""" -RETURN = r''' +RETURN = r""" changed: description: True if listing the RDS subnet group succeeds. type: bool @@ -175,7 +174,7 @@ sample: tag1: Tag1 tag2: Tag2 -''' +""" from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule diff --git a/plugins/modules/route53.py b/plugins/modules/route53.py index d8ff85be5e1..300f99287ea 100644 --- a/plugins/modules/route53.py +++ b/plugins/modules/route53.py @@ -3,7 +3,7 @@ # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: route53 version_added: 5.0.0 @@ -158,11 +158,11 @@ - Bruce Pennypacker (@bpennypacker) - Mike Buzzetti (@jimbydamonk) extends_documentation_fragment: - - amazon.aws.aws + - amazon.aws.common.modules - amazon.aws.boto3 -''' +""" -RETURN = r''' +RETURN = r""" nameservers: description: Nameservers associated with the zone. returned: when state is 'get' @@ -243,9 +243,9 @@ returned: always type: str sample: foo.bar.com. -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" - name: Add new.foo.com as an A record with 3 IPs and wait until the changes have been replicated amazon.aws.route53: state: present @@ -401,7 +401,7 @@ geo_location: country_code: US subdivision_code: TX -''' +""" from operator import itemgetter diff --git a/plugins/modules/route53_health_check.py b/plugins/modules/route53_health_check.py index dcb28a17d9a..4f6beba6d63 100644 --- a/plugins/modules/route53_health_check.py +++ b/plugins/modules/route53_health_check.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = ''' +DOCUMENTATION = r""" --- module: route53_health_check version_added: 5.0.0 @@ -122,13 +122,13 @@ notes: - Support for I(tags) and I(purge_tags) was added in release 2.1.0. extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Create a health-check for host1.example.com and use it in record amazon.aws.route53_health_check: state: present @@ -190,10 +190,9 @@ amazon.aws.route53_health_check: state: absent id: 12345678-abcd-abcd-abcd-0fxxxxxxxxxx +""" -''' - -RETURN = r''' +RETURN = r""" health_check: description: Information about the health check. returned: success @@ -274,7 +273,7 @@ type: dict returned: When the health check exists. sample: '{"my_key": "my_value"}' -''' +""" import uuid diff --git a/plugins/modules/route53_info.py b/plugins/modules/route53_info.py index 1eb7262a6e4..12d44ed8c88 100644 --- a/plugins/modules/route53_info.py +++ b/plugins/modules/route53_info.py @@ -2,7 +2,7 @@ # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" module: route53_info short_description: Retrieves route53 details using AWS methods version_added: 5.0.0 @@ -126,13 +126,12 @@ author: - Karen Cheng (@Etherdaemon) extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = r''' +EXAMPLES = r""" # Simple example of listing all hosted zones - name: List all hosted zones amazon.aws.route53_info: @@ -201,9 +200,9 @@ hosted_zone_id: "{{ AWSINFO.zone_id }}" start_record_name: "host1.workshop.test.io" register: RECORDS -''' +""" -RETURN = r''' +RETURN = r""" resource_record_sets: description: A list of resource record sets returned by list_resource_record_sets in boto3. returned: when I(query=record_sets) @@ -488,7 +487,7 @@ This field is deprecated and will be removed in 6.0.0 version release. type: dict returned: when I(query=health_check) and I(health_check_method=details) -''' +""" try: import botocore diff --git a/plugins/modules/route53_zone.py b/plugins/modules/route53_zone.py index c6b29018905..24b13fcb006 100644 --- a/plugins/modules/route53_zone.py +++ b/plugins/modules/route53_zone.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" module: route53_zone short_description: add or delete Route53 zones version_added: 5.0.0 @@ -45,17 +45,17 @@ - Note that you can't associate a reusable delegation set with a private hosted zone. type: str extends_documentation_fragment: - - amazon.aws.aws - - amazon.aws.ec2 + - amazon.aws.common.modules + - amazon.aws.region.modules - amazon.aws.tags - amazon.aws.boto3 notes: - Support for I(tags) and I(purge_tags) was added in release 2.1.0. author: - "Christopher Troup (@minichate)" -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" - name: create a public zone amazon.aws.route53_zone: zone: example.com @@ -93,9 +93,9 @@ tags: Support: Ansible Community purge_tags: true -''' +""" -RETURN = r''' +RETURN = r""" comment: description: optional hosted zone comment returned: when hosted zone exists @@ -135,7 +135,7 @@ description: tags associated with the zone returned: when tags are defined type: dict -''' +""" import time from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule diff --git a/plugins/modules/s3_bucket.py b/plugins/modules/s3_bucket.py index 73d9e6649c4..fdda8b9adf7 100644 --- a/plugins/modules/s3_bucket.py +++ b/plugins/modules/s3_bucket.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this library. If not, see . -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: s3_bucket version_added: 1.0.0 @@ -181,9 +181,9 @@ - Support for the C(S3_URL) environment variable has been deprecated and will be removed in a release after 2024-12-01, please use the I(endpoint_url) parameter or the C(AWS_URL) environment variable. -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. # Create a simple S3 bucket @@ -283,9 +283,9 @@ name: mys3bucket state: present acl: public-read -''' +""" -RETURN = r''' +RETURN = r""" encryption: description: - Server-side encryption of the objects in the S3 bucket. @@ -345,7 +345,7 @@ type: dict returned: I(state=present) sample: 'public-read' -''' +""" import json import time diff --git a/plugins/modules/s3_object.py b/plugins/modules/s3_object.py index 314fd37cfdc..dfb666ebb0b 100644 --- a/plugins/modules/s3_object.py +++ b/plugins/modules/s3_object.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = """ +DOCUMENTATION = r""" --- module: s3_object version_added: 1.0.0 @@ -255,7 +255,7 @@ - amazon.aws.boto3 """ -EXAMPLES = """ +EXAMPLES = r""" - name: Simple PUT operation amazon.aws.s3_object: bucket: mybucket @@ -365,7 +365,7 @@ object: /source/key.txt """ -RETURN = """ +RETURN = r""" msg: description: Message indicating the status of the operation. returned: always diff --git a/plugins/modules/s3_object_info.py b/plugins/modules/s3_object_info.py index 1a731e3892b..312f2c47fc8 100644 --- a/plugins/modules/s3_object_info.py +++ b/plugins/modules/s3_object_info.py @@ -2,7 +2,7 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://wwww.gnu.org/licenses/gpl-3.0.txt) -DOCUMENTATION = r''' +DOCUMENTATION = r""" --- module: s3_object_info version_added: 5.0.0 @@ -103,10 +103,9 @@ - amazon.aws.common.modules - amazon.aws.region.modules - amazon.aws.boto3 +""" -''' - -EXAMPLES = r''' +EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Retrieve a list of objects in S3 bucket @@ -147,10 +146,9 @@ attributes_list: - ETag - ObjectSize +""" -''' - -RETURN = r''' +RETURN = r""" s3_keys: description: List of object keys. returned: when only I(bucket_name) is specified and I(object_name), I(object_details) are not specified. @@ -429,7 +427,7 @@ returned: if it was upload with the object. type: str sample: "xxxxxxxxxxxx" -''' +""" try: import botocore