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

ELB info: return all LB if names is not defined #693

Conversation

christophemorio
Copy link
Contributor

SUMMARY

Documentation says

options:
  names:
    description:
      - List of ELB names to gather information about. Pass this option to gather information about a set of ELBs, otherwise, all ELBs are returned.

But doing this elb_classic_lb_info returns an empty list.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

elb_classic_lb_info

ADDITIONAL INFORMATION
- hosts: localhost
  tasks:
  - community.aws.elb_classic_lb_info: {}
    register: elb_info

  - debug: var=elb_info

$ ansible-playbook playbook.yaml
TASK [community.aws.elb_classic_lb_info] ********
ok: [localhost]

TASK [debug] ********
ok: [localhost] => {
    "elb_info": {
        "changed": false,
        "elbs": [],  # <-- should return list of all ELB
        "failed": false
    }
}

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review module module needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) labels Aug 19, 2021
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 raise this PR. I encountered this issue a couple of days ago when working on converting elb_classic_lb over to boto3 (ansible-collections/amazon.aws#377) and hadn't had chance to look into it yet.

From a quick look the code looks reasonable.

Please could you also add a test to https://github.com/ansible-collections/community.aws/blob/main/tests/integration/targets/elb_classic_lb/tasks/main.yml it only needs to be something as simple as

        - elb_classic_lb_info:
            names: '{{ omit }}'
          register: info

        - assert:
            that:
              - info.elbs | length > 0

@tremble tremble linked an issue Oct 22, 2021 that may be closed by this pull request
1 task
@tremble tremble force-pushed the elb_classic_lb_info-without-names branch from 142821e to f1853ea Compare October 22, 2021 09:27
@tremble tremble requested a review from markuman October 22, 2021 09:29
@ansibullbot ansibullbot added integration tests/integration tests tests labels Oct 22, 2021
@tremble tremble changed the title ELB info: returns all LB if names is not defined ELB info: return all LB if names is not defined Oct 22, 2021
@tremble
Copy link
Contributor

tremble commented Oct 22, 2021

recheck

@tremble tremble force-pushed the elb_classic_lb_info-without-names branch from bd80392 to 4aaad9a Compare October 22, 2021 14:31
@tremble tremble added the gate label Oct 24, 2021
Copy link
Contributor

@ansible-zuul ansible-zuul bot left a comment

Choose a reason for hiding this comment

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

LGTM!

@ansible-zuul ansible-zuul bot merged commit bebdd75 into ansible-collections:main Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review integration tests/integration module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Module elb_classic_lb_info does return noting unless names are given
3 participants