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

New module - AWS Glue connection #39492

Merged
merged 7 commits into from
May 24, 2018
Merged

Conversation

wimnat
Copy link
Contributor

@wimnat wimnat commented Apr 30, 2018

SUMMARY

New module for AWS Glue Connections

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

glue_connection

ANSIBLE VERSION
2.6
ADDITIONAL INFORMATION

@wimnat wimnat changed the title New module = AWS Glue connection New module - AWS Glue connection Apr 30, 2018
@ansibot ansibot added aws cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_module This PR includes a new module. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. labels Apr 30, 2018
@ansibot
Copy link
Contributor

ansibot commented Apr 30, 2018

The test ansible-test sanity --test pep8 [explain] failed with 3 errors:

lib/ansible/modules/cloud/amazon/glue_connection.py:37:17: W291 trailing whitespace
lib/ansible/modules/cloud/amazon/glue_connection.py:41:17: W291 trailing whitespace
lib/ansible/modules/cloud/amazon/glue_connection.py:306:77: E231 missing whitespace after ','

The test ansible-test sanity --test validate-modules [explain] failed with 4 errors:

lib/ansible/modules/cloud/amazon/glue_connection.py:0:0: E319 RETURN.creation_time.sample: not a valid value for dictionary value @ data['sample']. Got datetime.datetime(2018, 4, 21, 5, 19, 58, 326000)
lib/ansible/modules/cloud/amazon/glue_connection.py:0:0: E319 RETURN.creation_time.type: not a valid value for dictionary value @ data['type']. Got 'datetime'
lib/ansible/modules/cloud/amazon/glue_connection.py:0:0: E319 RETURN.last_updated_time.sample: not a valid value for dictionary value @ data['sample']. Got datetime.datetime(2018, 4, 21, 5, 19, 58, 326000)
lib/ansible/modules/cloud/amazon/glue_connection.py:0:0: E319 RETURN.last_updated_time.type: not a valid value for dictionary value @ data['type']. Got 'datetime'

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Apr 30, 2018
@ansibot
Copy link
Contributor

ansibot commented Apr 30, 2018

@Constantin007 @Constantin07 @Deepakkothandan @Etherdaemon @Java1Guy @Lujeni @Madhura-CSI @MichaelBaydoun @Sodki @adq @akazakov @alachaum @amir343 @anryko @bekelchik @bpennypacker @brandond @carsongee @chenl87 @defunctio @dkhenry @fiunchinho @fivethreeo @garethr @gunzy83 @gurumaia @hsingh @hyperized @iiibrad @infectsoldier @j-carl @jarv @Java1Guy @jimbydamonk @jmenga @joelthompson @jonhadfield @jonmer85 @joshsouza @jsdalton @jsmartin @kaczynskid @leedm777 @linuxdynasty @loia @lwade @MichaelBaydoun @michaeljs1990 @minichate @mjschultz @mmochan @nadirollo @nand0p @naslanidis @nathanwebsterdotme @nickball @orthanc @piontas @pjodouin @prasadkatti @psykotox @pwnall @raags @rickmendes @roadmapper @ryansydnor @scicoin-project @scottanderson42 @shepdelacreme @silviud @steynovich @tastychutney @tedder @tgerla @timmahoney @tombamford @tsiganenok @viper233 @whiter @willricardo @wilvk @zacblazic @zbal @zeekin @zimbatm

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Apr 30, 2018
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'''

from ansible.module_utils.aws.core import AnsibleAWSModule
from ansible.module_utils.ec2 import camel_dict_to_snake_dict, ec2_argument_spec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AnsibleAWSModule adds the ec2_argument_spec by default, so you can remove this import and just specify the module arguments in a dict. See lower half of https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/amazon/GUIDELINES.md#porting-code-to-ansibleawsmodule.

if module.params.get("security_groups") is not None or module.params.get("subnet_id") is not None:
params['ConnectionInput']['PhysicalConnectionRequirements'] = dict()
if module.params.get("security_groups") is not None:
params['ConnectionInput']['PhysicalConnectionRequirements']['SecurityGroupIdList'] = module.params.get("security_groups")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security_groups is documented as taking security group names or IDs. The docs could be updated or get_ec2_security_group_ids_from_names from module_utils.ec2 could be used.


DOCUMENTATION = '''
---
module: glue_connection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe aws_glue_connection instead?

- The type of the connection. Currently, only JDBC is supported; SFTP is not supported.
required: false
default: JDBC
choices: [ 'JDBC', 'SFTP' ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should SFTP be an option even provided at this point?

@s-hertel
Copy link
Contributor

I added some integration tests as per https://github.com/ansible/community/blob/master/group-aws/integration.md#policy and will work on updating CI with the IAM permissions for those.

@ansibot ansibot added the test This PR relates to tests. label Apr 30, 2018
@ansibot
Copy link
Contributor

ansibot commented Apr 30, 2018

The test ansible-test sanity --test integration-aliases [explain] failed with 1 error:

test/integration/targets/aws_glue_connection/aliases:0:0: missing alias `posix/ci/cloud/group[1-5]/aws` or `unsupported`

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Apr 30, 2018
@s-hertel s-hertel added needs_ci_update This PR is blocked as it requires an update to CI infrastructure before tests can pass in CI. and removed needs_triage Needs a first human triage before being processed. labels Apr 30, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Apr 30, 2018
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels May 7, 2018
@s-hertel s-hertel removed the needs_ci_update This PR is blocked as it requires an update to CI infrastructure before tests can pass in CI. label May 7, 2018
@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels May 19, 2018
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label May 21, 2018
@ryansb ryansb merged commit 49f569d into ansible:devel May 24, 2018
@wimnat wimnat deleted the aws-glue-connection branch May 25, 2018 03:54
gothicx pushed a commit to gothicx/ansible that referenced this pull request Jun 9, 2018
* 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
jacum pushed a commit to jacum/ansible that referenced this pull request Jun 26, 2018
* 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
@ansible ansible locked and limited conversation to collaborators May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 aws cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. new_module This PR includes a new module. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants