Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #1751/989f4dd8 backport][stable-6] Cleanup after renamed plugins #1753

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/20230908-alias-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trivial:
- Update integration tests to reflect renamed plugins
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
- 'alarm_info.metric_alarms | length == 0'

- name: create ec2 metric alarm with metrics
ec2_metric_alarm:
cloudwatch_metric_alarm:
state: present
name: '{{ alarm_full_name }}'
treat_missing_data: missing
Expand Down Expand Up @@ -444,7 +444,7 @@


- name: try to remove the alarm
ec2_metric_alarm:
cloudwatch_metric_alarm:
state: absent
name: '{{ alarm_full_name }}'
register: ec2_instance_metric_alarm_deletion_no_unit
Expand All @@ -466,7 +466,7 @@
- 'alarm_info_no_unit.metric_alarms | length == 0'

- name: create ec2 metric alarm by providing mutually exclusive values
ec2_metric_alarm:
cloudwatch_metric_alarm:
dimensions:
InstanceId: '{{ ec2_instance_results.instances[0].instance_id }}'
state: present
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

- name: lookup missing secret (skip)
set_fact:
missing_secret: "{{ lookup('amazon.aws.aws_secret', secret_name, on_missing=skip, **connection_args) }}"
missing_secret: "{{ lookup('amazon.aws.secretsmanager_secret', secret_name, on_missing=skip, **connection_args) }}"

- name: assert that missing_secret is defined
assert:
Expand All @@ -36,7 +36,7 @@

- name: lookup missing secret (warn)
set_fact:
missing_secret: "{{ lookup('amazon.aws.aws_secret', secret_name, on_missing=warn, **connection_args) }}"
missing_secret: "{{ lookup('amazon.aws.secretsmanager_secret', secret_name, on_missing=warn, **connection_args) }}"

- name: assert that missing_secret is defined
assert:
Expand All @@ -46,7 +46,7 @@

- name: lookup missing secret (error)
set_fact:
missing_secret: "{{ lookup('amazon.aws.aws_secret', secret_name, **connection_args) }}"
missing_secret: "{{ lookup('amazon.aws.secretsmanager_secret', secret_name, **connection_args) }}"
ignore_errors: True
register: get_missing_secret

Expand All @@ -56,7 +56,7 @@
- get_missing_secret is failed

- name: create secret "{{ secret_name }}"
aws_secret:
secretsmanager_secret:
name: "{{ secret_name }}"
secret: "{{ secret_value }}"
tags:
Expand All @@ -65,22 +65,22 @@

- name: read secret value
set_fact:
look_secret: "{{ lookup('amazon.aws.aws_secret', secret_name, **connection_args) }}"
look_secret: "{{ lookup('amazon.aws.secretsmanager_secret', secret_name, **connection_args) }}"

- name: assert that secret was successfully retrieved
assert:
that:
- look_secret == secret_value

- name: delete secret
aws_secret:
secretsmanager_secret:
name: "{{ secret_name }}"
state: absent
recovery_window: 7

- name: lookup deleted secret (skip)
set_fact:
deleted_secret: "{{ lookup('amazon.aws.aws_secret', secret_name, on_deleted=skip, **connection_args) }}"
deleted_secret: "{{ lookup('amazon.aws.secretsmanager_secret', secret_name, on_deleted=skip, **connection_args) }}"

- name: assert that deleted_secret is defined
assert:
Expand All @@ -90,7 +90,7 @@

- name: lookup deleted secret (warn)
set_fact:
deleted_secret: "{{ lookup('amazon.aws.aws_secret', secret_name, on_deleted=warn, **connection_args) }}"
deleted_secret: "{{ lookup('amazon.aws.secretsmanager_secret', secret_name, on_deleted=warn, **connection_args) }}"

- name: assert that deleted_secret is defined
assert:
Expand All @@ -100,7 +100,7 @@

- name: lookup deleted secret (error)
set_fact:
missing_secret: "{{ lookup('amazon.aws.aws_secret', secret_name, **connection_args) }}"
missing_secret: "{{ lookup('amazon.aws.secretsmanager_secret', secret_name, **connection_args) }}"
ignore_errors: True
register: get_deleted_secret

Expand All @@ -113,7 +113,7 @@

# delete secret created
- name: delete secret
aws_secret:
secretsmanager_secret:
name: "{{ secret_name }}"
state: absent
recovery_window: 0
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/setup_ec2_vpc/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
register: remaining_enis

- name: '(VPC Cleanup) Retrieve security group info based on VPC ID'
ec2_group_info:
ec2_security_group_info:
filters:
vpc-id: '{{ vpc_id }}'
register: remaining_groups
Expand Down