mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
|
---
|
||
|
- block:
|
||
|
- name: set up aws connection info
|
||
|
set_fact:
|
||
|
aws_connection_info: &aws_connection_info
|
||
|
aws_access_key: "{{ aws_access_key }}"
|
||
|
aws_secret_key: "{{ aws_secret_key }}"
|
||
|
security_token: "{{ security_token }}"
|
||
|
region: "{{ aws_region }}"
|
||
|
no_log: yes
|
||
|
|
||
|
- name: Ensure the resource doesn't exist
|
||
|
rds_instance:
|
||
|
id: "{{ instance_id }}"
|
||
|
state: absent
|
||
|
skip_final_snapshot: True
|
||
|
<<: *aws_connection_info
|
||
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- not result.changed
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- name: Create a DB instance with an invalid engine
|
||
|
rds_instance:
|
||
|
id: "{{ instance_id }}"
|
||
|
state: present
|
||
|
engine: thisisnotavalidengine
|
||
|
username: "{{ username }}"
|
||
|
password: "{{ password }}"
|
||
|
db_instance_class: "{{ db_instance_class }}"
|
||
|
allocated_storage: "{{ allocated_storage }}"
|
||
|
<<: *aws_connection_info
|
||
|
register: result
|
||
|
ignore_errors: True
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- result.failed
|
||
|
- '"DB engine thisisnotavalidengine should be one of" in result.msg'
|