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

Add module elb_security_group and tests #182

Closed
wants to merge 14 commits into from
Closed

Add module elb_security_group and tests #182

wants to merge 14 commits into from

Conversation

mmoyle
Copy link

@mmoyle mmoyle commented Aug 10, 2020

SUMMARY

Add module

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

elb_security_group

@ansibullbot
Copy link

@ansibullbot ansibullbot added affects_2.10 integration tests/integration module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR needs_triage new_contributor Help guide this first time contributor new_module New module new_plugin New plugin stale_ci CI is older than 7 days, rerun before merging tests tests labels Aug 19, 2020
@ansibullbot ansibullbot added the plugins plugin (any type) label Aug 27, 2020
Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to submit this new module.

Most of the suggestions below are nit-picks. However, there are a couple of things

  1. For net-new modules we generally prefer that they support check_mode
  2. When no change is made changed should return False
  3. Please add a changelog fragment: https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to

module.params.get('security_group_ids')
)

result['changed'] = True
Copy link
Contributor

Choose a reason for hiding this comment

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

This is always going to return true even if nothing changes

Copy link
Author

Choose a reason for hiding this comment

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

Hi @tremble ,I think a change will be made unless an exception is thrown or the same set of security group ids is supplied. I am not sure but boto3 may even set the same sgs again. The function does not return whether or not no change was made, and may in itself may not be idempotent, of course i can look if needed. I could first inspect what sgs are already attached and compare against them, but I am not sure if this information is worth the cost of an extra api call. Or? What do you advise in this situation?

plugins/modules/elb_security_group.py Outdated Show resolved Hide resolved
- "{{ test_subnets_msg['results'][1]['subnet']['id'] }}"
state: present
register: alb
- name: Attach a security group
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add tests for things like idempotency

original_message=''
)

module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

As a net-new module I'd rather see support for check_mode from day one.

plugins/modules/elb_security_group.py Outdated Show resolved Hide resolved
plugins/modules/elb_security_group.py Outdated Show resolved Hide resolved
plugins/modules/elb_security_group.py Outdated Show resolved Hide resolved
plugins/modules/elb_security_group.py Outdated Show resolved Hide resolved
plugins/modules/elb_security_group.py Outdated Show resolved Hide resolved
mmoyle and others added 9 commits September 17, 2020 16:34
Co-authored-by: Mark Chappell <mchappel@redhat.com>
Co-authored-by: Mark Chappell <mchappel@redhat.com>
Co-authored-by: Mark Chappell <mchappel@redhat.com>
Co-authored-by: Mark Chappell <mchappel@redhat.com>
Co-authored-by: Mark Chappell <mchappel@redhat.com>
randomize vcp cidr
Co-authored-by: Mark Chappell <mchappel@redhat.com>
@ansibullbot ansibullbot removed the stale_ci CI is older than 7 days, rerun before merging label Sep 22, 2020
@ansibullbot
Copy link

@mmoyle this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibullbot
Copy link

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

changelogs/fragments/182-add-elb-security-groups.yml:0:0: invalid section: minor_change

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

plugins/modules/elb_security_group.py:74:11: undefined-variable: Undefined variable 'camel_dict_to_snake_dict'

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

plugins/modules/elb_security_group.py:74:11: undefined-variable: Undefined variable 'camel_dict_to_snake_dict'

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

plugins/modules/elb_security_group.py:0:0: parameter-type-not-in-doc: Argument 'aws_ca_bundle' in argument_spec defines type as 'path' but documentation doesn't define type
plugins/modules/elb_security_group.py:0:0: parameter-type-not-in-doc: Argument 'aws_config' in argument_spec defines type as 'dict' but documentation doesn't define type
plugins/modules/elb_security_group.py:0:0: undocumented-parameter: Argument 'aws_ca_bundle' is listed in the argument_spec, but not documented in the module documentation
plugins/modules/elb_security_group.py:0:0: undocumented-parameter: Argument 'aws_config' is listed in the argument_spec, but not documented in the module documentation
plugins/modules/elb_security_group.py:0:0: undocumented-parameter: Argument 'aws_endpoint_url' is listed in the argument_spec, but not documented in the module documentation
plugins/modules/elb_security_group.py:0:0: undocumented-parameter: Argument 'aws_profile' is listed in the argument_spec, but not documented in the module documentation
plugins/modules/elb_security_group.py:0:0: undocumented-parameter: Argument 'aws_security_token' is listed in the argument_spec, but not documented in the module documentation
plugins/modules/elb_security_group.py:0:0: undocumented-parameter: Argument 'endpoint_url' is listed in the argument_spec, but not documented in the module documentation

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

changelogs/fragments/182-add-elb-security-groups.yml:0:0: invalid section: minor_change

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

plugins/modules/elb_security_group.py:74:11: undefined-variable: Undefined variable 'camel_dict_to_snake_dict'

click here for bot help

@ansibullbot ansibullbot added merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci CI is older than 7 days, rerun before merging labels Nov 16, 2020
@tremble
Copy link
Contributor

tremble commented Jul 7, 2022

@mmoyle,

Thanks for taking the time to open this PR.

This PR appears to have stalled out and has a number of open review points.

Looking at the elb_application_lb module we already support managing the Security Groups on an existing ALB. The existing support also appears to be a little more comprehensive, including supporting using security group names and idempotency. As such I'm going to close out this PR.

@tremble tremble closed this Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 integration tests/integration merge_commit This PR contains at least one merge commit. Please resolve! module module needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor new_module New module new_plugin New plugin plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants