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

digital_ocean_load_balancer_info cannot select LB by ID #35

Closed
Akasurde opened this issue Dec 14, 2020 · 3 comments
Closed

digital_ocean_load_balancer_info cannot select LB by ID #35

Akasurde opened this issue Dec 14, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@Akasurde
Copy link
Member

From @Akasurde on May 03, 2020 09:13

From @jrkarnes on May 01, 2020 19:37

SUMMARY

When attempting to use the digital_ocean_load_balancer_info module, specifying a load_balancer_id causes the module to experience a failure.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

/ansible/modules/cloud/digital_ocean/digital_ocean_load_balancer_info.py

ANSIBLE VERSION
ansible 2.9.7
  config file = /Users/jkarnes/.ansible.cfg
  configured module search path = [u'/Users/jkarnes/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/jkarnes/Library/Python/2.7/lib/python/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.16 (default, Jun 19 2019, 07:40:37) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)]
CONFIGURATION
DEFAULT_PRIVATE_KEY_FILE(/Users/jkarnes/.ansible.cfg) = /Users/jkarnes/.ssh/adaptive_access
HOST_KEY_CHECKING(/Users/jkarnes/.ansible.cfg) = False
OS / ENVIRONMENT

I'm running this locally against my own machine so I suppose this would be MacOS Mojave 10.14.6.
Model Name: MacBook Pro
Model Identifier: MacBookPro11,3

Not sure what else you want here as this is running against hosts: 127.0.01 and connection: local

STEPS TO REPRODUCE
  1. Create a digital ocean load balancer
  2. Use doctl compute load-balancer list to see your newly created load balancer. Capture it's id and use it for step 3
  3. Execute this extremely minimal playbook:
---
hosts: 127.0.0.1
  connection: local
  vars:
    do_load_balancer_id: "<WHATERVER YOU GOT FROM STEP 2>"
  tasks:
    - name: Get information about the load balancer
        digital_ocean_load_balancer_info:
          load_balancer_id: "{{ do_load_balancer_id }}"
EXPECTED RESULTS

I would expect to receive information about my load balancer, preferably in the form of a HashMap

ACTUAL RESULTS

Abject failure and sadness =(

 ________________________________________________ 
< TASK [Get information about the load balancer] >
 ------------------------------------------------ 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: /Users/jkarnes/Projects/AdaptiveRX/Rundeck/ansible_resources/do_test_cert_manage.yaml:40
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: jkarnes
<127.0.0.1> EXEC /bin/sh -c 'echo ~jkarnes && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /Users/jkarnes/.ansible/tmp `"&& mkdir /Users/jkarnes/.ansible/tmp/ansible-tmp-1588361182.66-55721-19160074506918 && echo ansible-tmp-1588361182.66-55721-19160074506918="` echo /Users/jkarnes/.ansible/tmp/ansible-tmp-1588361182.66-55721-19160074506918 `" ) && sleep 0'
Using module file /Users/jkarnes/Library/Python/2.7/lib/python/site-packages/ansible/modules/cloud/digital_ocean/digital_ocean_load_balancer_info.py
<127.0.0.1> PUT /Users/jkarnes/.ansible/tmp/ansible-local-55615iZU6zr/tmpCvhoQ5 TO /Users/jkarnes/.ansible/tmp/ansible-tmp-1588361182.66-55721-19160074506918/AnsiballZ_digital_ocean_load_balancer_info.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /Users/jkarnes/.ansible/tmp/ansible-tmp-1588361182.66-55721-19160074506918/ /Users/jkarnes/.ansible/tmp/ansible-tmp-1588361182.66-55721-19160074506918/AnsiballZ_digital_ocean_load_balancer_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/local/opt/python@2/bin/python2.7 /Users/jkarnes/.ansible/tmp/ansible-tmp-1588361182.66-55721-19160074506918/AnsiballZ_digital_ocean_load_balancer_info.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /Users/jkarnes/.ansible/tmp/ansible-tmp-1588361182.66-55721-19160074506918/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/var/folders/1w/6wt0nysn2lx6cb_nb3_7b8km7hvl82/T/ansible_digital_ocean_load_balancer_info_payload_OmOqob/ansible_digital_ocean_load_balancer_info_payload.zip/ansible/modules/cloud/digital_ocean/digital_ocean_load_balancer_info.py", line 114, in main
  File "/var/folders/1w/6wt0nysn2lx6cb_nb3_7b8km7hvl82/T/ansible_digital_ocean_load_balancer_info_payload_OmOqob/ansible_digital_ocean_load_balancer_info_payload.zip/ansible/modules/cloud/digital_ocean/digital_ocean_load_balancer_info.py", line 97, in core
KeyError: 'load_balancer'
fatal: [127.0.0.1]: FAILED! => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "load_balancer_id": "39ad1e52-e861-4d0a-8966-1cb6717ff705", 
            "oauth_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
            "timeout": 30, 
            "validate_certs": true
        }
    }, 
    "msg": "'load_balancer'"
}
Bonus Information

If you run the digital_ocean_load_balancer_info module without specifying the load_balancer_id parameter, you will get a successful invocation with data in the response. Frustratingly, the "id" field for the load balancer I was trying to get data for was present in the response.

Copied from original issue: ansible/ansible#69283

Copied from original issue: ansible/ansible#265

@Akasurde
Copy link
Member Author

From @ansibullbot on May 03, 2020 09:15

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@Akasurde
Copy link
Member Author

From @ansibullbot on May 03, 2020 09:15

cc @BondAnthony @mgregson
click here for bot help

@Akasurde
Copy link
Member Author

From @jrkarnes on May 23, 2020 19:02

Is there any progress on this?

andrewsomething added a commit to andrewsomething/community.digitalocean that referenced this issue Apr 2, 2021
@gundalow gundalow changed the title [Digital Ocean] digital_ocean_load_balancer_info cannot select LB by ID digital_ocean_load_balancer_info cannot select LB by ID Apr 2, 2021
@gundalow gundalow added the bug Something isn't working label Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants