mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-19 15:39:10 -07:00
New module: AWS Glue connection (#39492)
* New module = AWS Glue connection * Add a few initial integration tests * Add alias for CI * module rename * finish module rename * add loop when getting glue connection again so we dont get None * Limit number of retries to get new glue connection info
This commit is contained in:
parent
ba4680c141
commit
49f569d915
3 changed files with 418 additions and 0 deletions
2
test/integration/targets/aws_glue_connection/aliases
Normal file
2
test/integration/targets/aws_glue_connection/aliases
Normal file
|
@ -0,0 +1,2 @@
|
|||
cloud/aws
|
||||
posix/ci/cloud/group4/aws
|
87
test/integration/targets/aws_glue_connection/tasks/main.yml
Normal file
87
test/integration/targets/aws_glue_connection/tasks/main.yml
Normal file
|
@ -0,0 +1,87 @@
|
|||
- block:
|
||||
|
||||
# TODO: description, match_criteria, security_groups, and subnet_id are unused module options
|
||||
|
||||
- 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: create glue connection
|
||||
aws_glue_connection:
|
||||
name: "{{ resource_prefix }}"
|
||||
connection_properties:
|
||||
JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}"
|
||||
USERNAME: my-username
|
||||
PASSWORD: my-password
|
||||
state: present
|
||||
<<: *aws_connection_info
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result.changed
|
||||
|
||||
- name: test idempotence creating glue connection
|
||||
aws_glue_connection:
|
||||
name: "{{ resource_prefix }}"
|
||||
connection_properties:
|
||||
JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}"
|
||||
USERNAME: my-username
|
||||
PASSWORD: my-password
|
||||
state: present
|
||||
<<: *aws_connection_info
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- not result.changed
|
||||
|
||||
- name: test updating JDBC connection url
|
||||
aws_glue_connection:
|
||||
name: "{{ resource_prefix }}"
|
||||
connection_properties:
|
||||
JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}-updated"
|
||||
USERNAME: my-username
|
||||
PASSWORD: my-password
|
||||
state: present
|
||||
<<: *aws_connection_info
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result.changed
|
||||
|
||||
- name: delete glue connection
|
||||
aws_glue_connection:
|
||||
name: "{{ resource_prefix }}"
|
||||
state: absent
|
||||
<<: *aws_connection_info
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result.changed
|
||||
|
||||
- name: test idempotence removing glue connection
|
||||
aws_glue_connection:
|
||||
name: "{{ resource_prefix }}"
|
||||
state: absent
|
||||
<<: *aws_connection_info
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- not result.changed
|
||||
|
||||
always:
|
||||
|
||||
- name: delete glue connection
|
||||
aws_glue_connection:
|
||||
name: "{{ resource_prefix }}"
|
||||
state: absent
|
||||
<<: *aws_connection_info
|
Loading…
Add table
Add a link
Reference in a new issue