diff options
Diffstat (limited to 'ansible_collections/amazon/aws')
10 files changed, 107 insertions, 21 deletions
diff --git a/ansible_collections/amazon/aws/CHANGELOG.rst b/ansible_collections/amazon/aws/CHANGELOG.rst index f867fc9e4..7a4fa628a 100644 --- a/ansible_collections/amazon/aws/CHANGELOG.rst +++ b/ansible_collections/amazon/aws/CHANGELOG.rst @@ -4,6 +4,21 @@ amazon.aws Release Notes .. contents:: Topics +v8.0.1 +====== + +Release Summary +--------------- + +This release includes some bug fixes for the `s3_object`, `ec2_instance` and `backup_plan_info` modules. + +Bugfixes +-------- + +- backup_plan_info - Bugfix to enable getting info of all backup plans (https://github.com/ansible-collections/amazon.aws/pull/2083). +- ec2_instance - do not ignore IPv6 addresses when a single network interface is specified (https://github.com/ansible-collections/amazon.aws/pull/1979). +- s3_object - fixed issue which was causing ``MemoryError`` exceptions when downloading large files (https://github.com/ansible-collections/amazon.aws/issues/2107). + v8.0.0 ====== diff --git a/ansible_collections/amazon/aws/FILES.json b/ansible_collections/amazon/aws/FILES.json index ad0709691..5ab9c8f81 100644 --- a/ansible_collections/amazon/aws/FILES.json +++ b/ansible_collections/amazon/aws/FILES.json @@ -221,7 +221,7 @@ "name": "changelogs/changelog.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d715aea5ddd297081527d05cc6d228ce4d3e181dcc9bb050ccbd6a6d8952d73a", + "chksum_sha256": "f6d1f00ee0eececd872d0f458d345624da9358ae68c8ca582a3425fe04d0c9ed", "format": 1 }, { @@ -256,7 +256,7 @@ "name": "docs/docsite/rst/CHANGELOG.rst", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "da8a721530a2d8c3c3e98ddc0f99b457215be51f4dac8b2a89f388a4ed0813c9", + "chksum_sha256": "6530e4dba4b633fc2a3f72c6f6f095a1774152817b945b350af39ca71b90ccc7", "format": 1 }, { @@ -543,7 +543,7 @@ "name": "plugins/module_utils/common.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b4931cbe751c155b1c71aae1b5c36f22301d289c7b2051e821fe51613c8a55a9", + "chksum_sha256": "509e4309e0a800b28877fefb7069fa1c631d8ec82700c113b768973de67ae39f", "format": 1 }, { @@ -739,7 +739,7 @@ "name": "plugins/modules/backup_plan_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9366677f43a8135847f52a1b1096f64efe1d072fe61d31040d61abfaa8971ff0", + "chksum_sha256": "21b12b755f7218b9fba1747e7ac8bf13a16784b77661fd13b4458cdbecd1953e", "format": 1 }, { @@ -921,7 +921,7 @@ "name": "plugins/modules/ec2_instance.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ffd0c2409add19494978e82ca7451aed82d416dc6fc3702a0dff629cbe6ece6e", + "chksum_sha256": "4a83e8de49534d032c7d81e32a1439e04c48803dc09392c3c4638296f73709ef", "format": 1 }, { @@ -1467,7 +1467,7 @@ "name": "plugins/modules/s3_object.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e17e5c421f076a0748478720a844df908d2350c46b63c8c03769995352d03da0", + "chksum_sha256": "985047a0b4e4e54b33ed8aff159e5511d3ad02ef6e10408faadadabba5d8863e", "format": 1 }, { @@ -1852,7 +1852,7 @@ "name": "tests/integration/targets/backup_plan/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "aa2adbe631ff74e50cd0cbd7fe7e2c36d532e47c75cf95efea01ba3d0e313cdf", + "chksum_sha256": "a4ce0be3a740f111d89bb2ad4e55fe00d70ef45a2fb7bf44c87bfe455b15345c", "format": 1 }, { @@ -11806,7 +11806,7 @@ "name": "CHANGELOG.rst", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "da8a721530a2d8c3c3e98ddc0f99b457215be51f4dac8b2a89f388a4ed0813c9", + "chksum_sha256": "6530e4dba4b633fc2a3f72c6f6f095a1774152817b945b350af39ca71b90ccc7", "format": 1 }, { diff --git a/ansible_collections/amazon/aws/MANIFEST.json b/ansible_collections/amazon/aws/MANIFEST.json index a1dd8b884..056adfaf0 100644 --- a/ansible_collections/amazon/aws/MANIFEST.json +++ b/ansible_collections/amazon/aws/MANIFEST.json @@ -2,7 +2,7 @@ "collection_info": { "namespace": "amazon", "name": "aws", - "version": "8.0.0", + "version": "8.0.1", "authors": [ "Ansible (https://github.com/ansible)" ], @@ -25,7 +25,7 @@ "name": "FILES.json", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3973d6f227d778fb935a07725724715ec807dc1b82e133e1f9fd73b95968b735", + "chksum_sha256": "a1aac297de79ad7bcb7613aafc27594950c06e3bb9a9f75fd77d5031b8369c6e", "format": 1 }, "format": 1 diff --git a/ansible_collections/amazon/aws/changelogs/changelog.yaml b/ansible_collections/amazon/aws/changelogs/changelog.yaml index 546b1fe22..c02fa995c 100644 --- a/ansible_collections/amazon/aws/changelogs/changelog.yaml +++ b/ansible_collections/amazon/aws/changelogs/changelog.yaml @@ -3026,3 +3026,19 @@ releases: - sanity-boto3.yml - sanity-simple.yml release_date: '2024-05-16' + 8.0.1: + changes: + bugfixes: + - backup_plan_info - Bugfix to enable getting info of all backup plans (https://github.com/ansible-collections/amazon.aws/pull/2083). + - ec2_instance - do not ignore IPv6 addresses when a single network interface + is specified (https://github.com/ansible-collections/amazon.aws/pull/1979). + - s3_object - fixed issue which was causing ``MemoryError`` exceptions when + downloading large files (https://github.com/ansible-collections/amazon.aws/issues/2107). + release_summary: This release includes some bug fixes for the `s3_object`, `ec2_instance` + and `backup_plan_info` modules. + fragments: + - 1979-do-not-ignore-ipv6-addresses.yaml + - 2083-backup_plan_info-bugfix-get-info-for-all-plans.yml + - 2107-s3_download.yml + - release_summary.yml + release_date: '2024-06-05' diff --git a/ansible_collections/amazon/aws/docs/docsite/rst/CHANGELOG.rst b/ansible_collections/amazon/aws/docs/docsite/rst/CHANGELOG.rst index f867fc9e4..7a4fa628a 100644 --- a/ansible_collections/amazon/aws/docs/docsite/rst/CHANGELOG.rst +++ b/ansible_collections/amazon/aws/docs/docsite/rst/CHANGELOG.rst @@ -4,6 +4,21 @@ amazon.aws Release Notes .. contents:: Topics +v8.0.1 +====== + +Release Summary +--------------- + +This release includes some bug fixes for the `s3_object`, `ec2_instance` and `backup_plan_info` modules. + +Bugfixes +-------- + +- backup_plan_info - Bugfix to enable getting info of all backup plans (https://github.com/ansible-collections/amazon.aws/pull/2083). +- ec2_instance - do not ignore IPv6 addresses when a single network interface is specified (https://github.com/ansible-collections/amazon.aws/pull/1979). +- s3_object - fixed issue which was causing ``MemoryError`` exceptions when downloading large files (https://github.com/ansible-collections/amazon.aws/issues/2107). + v8.0.0 ====== diff --git a/ansible_collections/amazon/aws/plugins/module_utils/common.py b/ansible_collections/amazon/aws/plugins/module_utils/common.py index e802a8d80..ae768e2e3 100644 --- a/ansible_collections/amazon/aws/plugins/module_utils/common.py +++ b/ansible_collections/amazon/aws/plugins/module_utils/common.py @@ -4,7 +4,7 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) AMAZON_AWS_COLLECTION_NAME = "amazon.aws" -AMAZON_AWS_COLLECTION_VERSION = "8.0.0" +AMAZON_AWS_COLLECTION_VERSION = "8.0.1" _collection_info_context = { diff --git a/ansible_collections/amazon/aws/plugins/modules/backup_plan_info.py b/ansible_collections/amazon/aws/plugins/modules/backup_plan_info.py index 096857d5b..98f49f6b6 100644 --- a/ansible_collections/amazon/aws/plugins/modules/backup_plan_info.py +++ b/ansible_collections/amazon/aws/plugins/modules/backup_plan_info.py @@ -20,7 +20,6 @@ options: backup_plan_names: type: list elements: str - required: true description: - Specifies a list of plan names. extends_documentation_fragment: @@ -31,10 +30,11 @@ extends_documentation_fragment: EXAMPLES = r""" # Note: These examples do not set authentication details, see the AWS Guide for details. -# Gather information about all backup plans -- amazon.aws.backup_plan_info -# Gather information about a particular backup plan -- amazon.aws.backup_plan_info: +- name: Gather information about all backup plans + amazon.aws.backup_plan_info: + +- name: Gather information about a particular backup plan + amazon.aws.backup_plan_info: backup plan_names: - elastic """ @@ -110,10 +110,21 @@ from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleA from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry +def get_all_backup_plans_info(client): + paginator = client.get_paginator("list_backup_plans") + return paginator.paginate().build_full_result() + + def get_backup_plan_detail(client, module): backup_plan_list = [] backup_plan_names = module.params.get("backup_plan_names") + if backup_plan_names is None: + backup_plan_names = [] + backup_plan_list_info = get_all_backup_plans_info(client)["BackupPlansList"] + for backup_plan in backup_plan_list_info: + backup_plan_names.append(backup_plan["BackupPlanName"]) + for name in backup_plan_names: backup_plan_list.extend(get_plan_details(module, client, name)) @@ -122,7 +133,7 @@ def get_backup_plan_detail(client, module): def main(): argument_spec = dict( - backup_plan_names=dict(type="list", elements="str", required=True), + backup_plan_names=dict(type="list", elements="str"), ) module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True) diff --git a/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py b/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py index c09cce97b..9f5c3eb65 100644 --- a/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py +++ b/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py @@ -1339,6 +1339,9 @@ def build_network_spec(params): sub = get_default_subnet(default_vpc, availability_zone=module.params.get("availability_zone")) spec["SubnetId"] = sub["SubnetId"] + if network.get("ipv6_addresses"): + spec["Ipv6Addresses"] = [{"Ipv6Address": a} for a in network.get("ipv6_addresses", [])] + if network.get("private_ip_address"): spec["PrivateIpAddress"] = network["private_ip_address"] diff --git a/ansible_collections/amazon/aws/plugins/modules/s3_object.py b/ansible_collections/amazon/aws/plugins/modules/s3_object.py index 0486d3b9f..c3e45004a 100644 --- a/ansible_collections/amazon/aws/plugins/modules/s3_object.py +++ b/ansible_collections/amazon/aws/plugins/modules/s3_object.py @@ -783,9 +783,6 @@ def upload_s3file( def download_s3file(module, s3, bucket, obj, dest, retries, version=None): if module.check_mode: module.exit_json(msg="GET operation skipped - running in check mode", changed=True) - # retries is the number of loops; range/xrange needs to be one - # more to get that count of loops. - _get_object_content(module, s3, bucket, obj, version) optional_kwargs = {"ExtraArgs": {"VersionId": version}} if version else {} for x in range(0, retries + 1): diff --git a/ansible_collections/amazon/aws/tests/integration/targets/backup_plan/tasks/main.yml b/ansible_collections/amazon/aws/tests/integration/targets/backup_plan/tasks/main.yml index ee8f62ec9..79e6e1479 100644 --- a/ansible_collections/amazon/aws/tests/integration/targets/backup_plan/tasks/main.yml +++ b/ansible_collections/amazon/aws/tests/integration/targets/backup_plan/tasks/main.yml @@ -344,12 +344,41 @@ - backup_plan_create_result.exists is true - backup_plan_create_result.changed is false + - name: Create another backup plan + amazon.aws.backup_plan: + backup_plan_name: "{{ backup_plan_name }}-1" + rules: + - rule_name: daily + target_backup_vault_name: "{{ backup_vault_name }}" + tags: + Environment: Test + register: backup_plan_create_result_1 + + - name: Verify backup plan create result + ansible.builtin.assert: + that: + - backup_plan_create_result_1.exists is true + - backup_plan_create_result_1.changed is true + + - name: Get info of all install plans + amazon.aws.backup_plan_info: + register: backup_plan_info_result + + - name: Assert that info of all backup plans is fetched + ansible.builtin.assert: + that: + - backup_plan_info_result is not failed + - backup_plan_info_result.backup_plans | length > 1 + always: - name: Delete AWS Backup plan created during this test amazon.aws.backup_plan: - backup_plan_name: "{{ backup_plan_name }}" + backup_plan_name: "{{ item }}" state: absent ignore_errors: true + with_items: + - "{{ backup_plan_name }}" + - "{{ backup_plan_name }}-1" - name: Delete AWS Backup vault created during this test amazon.aws.backup_vault: |