mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
136 lines
3.5 KiB
YAML
136 lines
3.5 KiB
YAML
---
|
|
|
|
- name: set connection information for all tasks
|
|
set_fact:
|
|
aws_connection_info: &aws_connection_info
|
|
aws_access_key: "{{ aws_access_key }}"
|
|
aws_secret_key: "{{ aws_secret_key }}"
|
|
region: "{{ aws_region }}"
|
|
dms_identifier: "{{ resource_prefix }}-dms"
|
|
no_log: yes
|
|
|
|
- block:
|
|
- name: create endpoints
|
|
dms_endpoint:
|
|
state: present
|
|
endpointidentifier: "{{ dms_identifier }}"
|
|
endpointtype: source
|
|
enginename: aurora
|
|
username: testing
|
|
password: testint1234
|
|
servername: "{{ resource_prefix }}.exampledomain.com"
|
|
port: 3306
|
|
databasename: 'testdb'
|
|
sslmode: none
|
|
<<: *aws_connection_info
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result is changed
|
|
- result is not failed
|
|
|
|
- name: create endpoints no change
|
|
dms_endpoint:
|
|
state: present
|
|
endpointidentifier: "{{ dms_identifier }}"
|
|
endpointtype: source
|
|
enginename: aurora
|
|
username: testing
|
|
password: testint1234
|
|
servername: "{{ resource_prefix }}.exampledomain.com"
|
|
port: 3306
|
|
databasename: 'testdb'
|
|
sslmode: none
|
|
<<: *aws_connection_info
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result is not changed
|
|
- result is not failed
|
|
|
|
- name: update endpoints
|
|
dms_endpoint:
|
|
state: present
|
|
endpointidentifier: "{{ dms_identifier }}"
|
|
endpointtype: source
|
|
enginename: aurora
|
|
username: testing
|
|
password: testint1234
|
|
servername: "{{ resource_prefix }}.exampledomain.com"
|
|
port: 3306
|
|
databasename: 'testdb2'
|
|
sslmode: none
|
|
<<: *aws_connection_info
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result is changed
|
|
- result is not failed
|
|
|
|
- name: update endpoints no change
|
|
dms_endpoint:
|
|
state: present
|
|
endpointidentifier: "{{ dms_identifier }}"
|
|
endpointtype: source
|
|
enginename: aurora
|
|
username: testing
|
|
password: testint1234
|
|
servername: "{{ resource_prefix }}.exampledomain.com"
|
|
port: 3306
|
|
databasename: 'testdb2'
|
|
sslmode: none
|
|
<<: *aws_connection_info
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result is not changed
|
|
- result is not failed
|
|
|
|
always:
|
|
- name: delete endpoints
|
|
dms_endpoint:
|
|
state: absent
|
|
endpointidentifier: "{{ dms_identifier }}"
|
|
endpointtype: source
|
|
enginename: aurora
|
|
username: testing
|
|
password: testint1234
|
|
servername: "{{ resource_prefix }}.exampledomain.com"
|
|
port: 3306
|
|
databasename: 'testdb'
|
|
sslmode: none
|
|
wait: True
|
|
timeout: 60
|
|
retries: 10
|
|
<<: *aws_connection_info
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result is changed
|
|
- result is not failed
|
|
|
|
- name: delete endpoints no change
|
|
dms_endpoint:
|
|
state: absent
|
|
endpointidentifier: "{{ dms_identifier }}"
|
|
endpointtype: source
|
|
enginename: aurora
|
|
username: testing
|
|
password: testint1234
|
|
servername: "{{ resource_prefix }}.exampledomain.com"
|
|
port: 3306
|
|
databasename: 'testdb'
|
|
sslmode: none
|
|
wait: False
|
|
<<: *aws_connection_info
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result is not changed
|
|
- result is not failed |