-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update meta/runtime.yml, modules and tests
add changelog file
- Loading branch information
Showing
9 changed files
with
106 additions
and
93 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...ogs/fragments/migrate_autoscaling_instance_refresh_autoscaling_instance_refresh_info.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
major_changes: | ||
- autoscaling_instance_refresh - The module has been migrated from the ``community.aws`` | ||
collection. Playbooks using the Fully Qualified Collection Name for this module | ||
should be updated to use ``amazon.aws.autoscaling_instance_refresh`` (https://github.com/ansible-collections/amazon.aws/pull/2338). | ||
- autoscaling_instance_refresh_info - The module has been migrated from the ``community.aws`` | ||
collection. Playbooks using the Fully Qualified Collection Name for this module | ||
should be updated to use ``amazon.aws.autoscaling_instance_refresh_info`` (https://github.com/ansible-collections/amazon.aws/pull/2338). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 18 additions & 18 deletions
36
tests/integration/targets/autoscaling_instance_refresh/tasks/instance_refresh_info.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,99 @@ | ||
--- | ||
- name: Test getting info for an ASG name | ||
autoscaling_instance_refresh_info: | ||
amazon.aws.autoscaling_instance_refresh_info: | ||
name: "{{ asg_name }}" | ||
register: output | ||
|
||
- name: Assert that the correct number of records are returned | ||
assert: | ||
ansible.builtin.assert: | ||
that: | ||
- output.instance_refreshes | map(attribute='instance_refresh_id') | unique | length == 7 | ||
|
||
- name: Test using fake refresh ID | ||
autoscaling_instance_refresh_info: | ||
amazon.aws.autoscaling_instance_refresh_info: | ||
name: "{{ asg_name }}" | ||
ids: ['0e367f58-blabla-bla-bla-ca870dc5dbfe'] | ||
register: output | ||
|
||
- name: Assert that no record is returned | ||
assert: | ||
ansible.builtin.assert: | ||
that: | ||
- output.instance_refreshes | length == 0 | ||
|
||
- name: Test using a real refresh ID | ||
autoscaling_instance_refresh_info: | ||
amazon.aws.autoscaling_instance_refresh_info: | ||
name: "{{ asg_name }}" | ||
ids: [ '{{ refreshout.instance_refreshes.instance_refresh_id }}' ] | ||
register: output | ||
|
||
- name: Assert that the correct record is returned | ||
assert: | ||
ansible.builtin.assert: | ||
that: | ||
- output.instance_refreshes | length == 1 | ||
|
||
- name: Test getting info for an ASG name which doesn't exist | ||
autoscaling_instance_refresh_info: | ||
amazon.aws.autoscaling_instance_refresh_info: | ||
name: n0n3x1stentname27b | ||
ignore_errors: true | ||
register: output | ||
|
||
- name: Assert that module failed to return record | ||
assert: | ||
ansible.builtin.assert: | ||
that: | ||
- "'Failed to describe InstanceRefreshes: An error occurred (ValidationError) when calling the DescribeInstanceRefreshes operation: AutoScalingGroup name not found - AutoScalingGroup n0n3x1stentname27b not found' in output.msg" | ||
|
||
- name: Retrieve instance refresh info | ||
autoscaling_instance_refresh_info: | ||
amazon.aws.autoscaling_instance_refresh_info: | ||
name: "{{ asg_name }}" | ||
register: output | ||
|
||
- name: Assert that the correct number of records are returned | ||
assert: | ||
ansible.builtin.assert: | ||
that: | ||
- output.instance_refreshes | length == 7 | ||
|
||
- name: Retrieve instance refresh info using next_token | ||
autoscaling_instance_refresh_info: | ||
amazon.aws.autoscaling_instance_refresh_info: | ||
name: "{{ asg_name }}" | ||
next_token: "fake-token-123" | ||
ignore_errors: true | ||
register: output | ||
|
||
- name: Assert that valid message with fake-token is returned | ||
assert: | ||
ansible.builtin.assert: | ||
that: | ||
- '"Failed to describe InstanceRefreshes: An error occurred (InvalidNextToken) when calling the DescribeInstanceRefreshes operation: The token ''********'' is invalid." in output.msg' | ||
|
||
- name: Retrieve instance refresh info using max_records | ||
autoscaling_instance_refresh_info: | ||
amazon.aws.autoscaling_instance_refresh_info: | ||
name: "{{ asg_name }}" | ||
max_records: 1 | ||
register: output_with_token | ||
|
||
- name: Assert that max records=1 returns no more than one record | ||
assert: | ||
ansible.builtin.assert: | ||
that: | ||
- output_with_token.instance_refreshes | length == 1 | ||
|
||
- name: Retrieve instance refresh using valid token | ||
autoscaling_instance_refresh_info: | ||
amazon.aws.autoscaling_instance_refresh_info: | ||
name: "{{ asg_name }}" | ||
next_token: "{{ output_with_token.next_token }}" | ||
register: output | ||
|
||
- name: Assert that valid message with real-token is returned | ||
assert: | ||
ansible.builtin.assert: | ||
that: | ||
- output.instance_refreshes | length == 6 | ||
|
||
- name: Test using both real nextToken and max_records=1 | ||
autoscaling_instance_refresh_info: | ||
amazon.aws.autoscaling_instance_refresh_info: | ||
name: "{{ asg_name }}" | ||
max_records: 1 | ||
next_token: "{{ output_with_token.next_token }}" | ||
register: output | ||
|
||
- name: Assert that only one instance refresh is returned | ||
assert: | ||
ansible.builtin.assert: | ||
that: | ||
- output.instance_refreshes | length == 1 |
Oops, something went wrong.