-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
88 additions
and
8 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ states | |
modify | ||
tagging | ||
replica | ||
upgrade | ||
|
||
# TODO: uncomment after adding rds_cluster module | ||
# aurora | ||
|
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 |
---|---|---|
|
@@ -6,6 +6,6 @@ | |
- hosts: all | ||
gather_facts: no | ||
strategy: free | ||
serial: 8 | ||
serial: 9 | ||
roles: | ||
- rds_instance |
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
86 changes: 86 additions & 0 deletions
86
tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_upgrade.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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
- block: | ||
- name: Ensure the resource doesn't exist | ||
rds_instance: | ||
id: "{{ instance_id }}" | ||
state: absent | ||
skip_final_snapshot: True | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- not result.changed | ||
ignore_errors: yes | ||
|
||
- name: Create a mariadb instance | ||
rds_instance: | ||
id: "{{ instance_id }}" | ||
state: present | ||
engine: mariadb | ||
engine_version: "{{ mariadb_engine_version }}" | ||
allow_major_version_upgrade: true | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
db_instance_class: "{{ db_instance_class }}" | ||
allocated_storage: "{{ io1_allocated_storage }}" | ||
storage_type: "{{ storage_type }}" | ||
iops: "{{ iops }}" | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- result.changed | ||
- "result.db_instance_identifier == '{{ instance_id }}'" | ||
|
||
# Test upgrade of DB instance | ||
|
||
- name: Uprade a mariadb instance | ||
rds_instance: | ||
id: "{{ instance_id }}" | ||
state: present | ||
engine: mariadb | ||
engine_version: "{{ mariadb_engine_version_2 }}" | ||
allow_major_version_upgrade: true | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
db_instance_class: "{{ db_instance_class }}" | ||
allocated_storage: "{{ io1_allocated_storage }}" | ||
storage_type: "{{ storage_type }}" | ||
iops: "{{ iops }}" | ||
apply_immediately: True | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- result.changed | ||
- '"engine_version" in result.pending_modified_values or result.engine_version == mariadb_engine_version_2' | ||
|
||
- name: Idempotence uprading a mariadb instance | ||
rds_instance: | ||
id: "{{ instance_id }}" | ||
state: present | ||
engine: mariadb | ||
engine_version: "{{ mariadb_engine_version_2 }}" | ||
allow_major_version_upgrade: true | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
db_instance_class: "{{ db_instance_class }}" | ||
allocated_storage: "{{ io1_allocated_storage }}" | ||
storage_type: "{{ storage_type }}" | ||
iops: "{{ iops }}" | ||
apply_immediately: True | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- not result.changed | ||
- '"engine_version" in result.pending_modified_values or result.engine_version == mariadb_engine_version_2' | ||
|
||
always: | ||
- name: Delete the instance | ||
rds_instance: | ||
id: "{{ instance_id }}" | ||
state: absent | ||
skip_final_snapshot: True | ||
wait: false | ||
ignore_errors: yes |