ansible-collections / hetzner.hcloud

A collection to manage resources on Hetzner Cloud
https://galaxy.ansible.com/ui/repo/published/hetzner/hcloud
GNU General Public License v3.0
111 stars 39 forks source link

hetzner.hcloud.hcloud_load_balancer failing on dns_ptr error (from hcloud-python) #106

Closed ondrejkolin closed 3 years ago

ondrejkolin commented 3 years ago
SUMMARY

The hcloud_load_balancer is failing on keyword argument error in the Python hcloud_load_balancer.py file.

  File "/home/vsts/.local/lib/python3.8/site-packages/hcloud/load_balancers/client.py", line 311, in <listcomp>
    BoundLoadBalancer(self, load_balancer_data) for load_balancer_data in response["load_balancers"]
  File "/home/vsts/.local/lib/python3.8/site-packages/hcloud/load_balancers/client.py", line 29, in __init__
    ipv4_address = IPv4Address(**public_net['ipv4'])
ISSUE TYPE
COMPONENT NAME

hcloud_load_balancer

ANSIBLE VERSION
ansible==2.10.7
COLLECTION VERSION
# /home/vsts/.local/lib/python3.8/site-packages/ansible_collections
Collection                Version
------------------------- -------
amazon.aws                1.4.0  
junipernetworks.junos     1.3.0  
mellanox.onyx             1.0.0  
netapp.aws                20.9.0 
netapp.elementsw          20.11.0
netapp.ontap              20.12.0
netapp_eseries.santricity 1.1.0  
netbox.netbox             1.2.1  
ngine_io.cloudstack       1.2.0  
ngine_io.exoscale         1.0.0  
ngine_io.vultr            1.1.0  
openstack.cloud           1.2.1  
openvswitch.openvswitch   1.1.0  
ovirt.ovirt               1.3.0  
purestorage.flasharray    1.6.2  
purestorage.flashblade    1.4.0  
servicenow.servicenow     1.0.4  
splunk.es                 1.0.2  
theforeman.foreman        1.5.1  
vyos.vyos                 1.1.1  
wti.remote                1.0.1  
CONFIGURATION
ansible-config dump --only-changed
( nothing )
OS / ENVIRONMENT

Linux fv-az234-103 5.8.0-1039-azure #42~20.04.1-Ubuntu SMP Thu Jul 15 14:11:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux cat /etc/os-release NAME="Ubuntu" VERSION="20.04.2 LTS (Focal Fossa)"

STEPS TO REPRODUCE
- name: Create the main load balancer
  hetzner.hcloud.hcloud_load_balancer:
    api_token: '{{hetzner_api_token}}'
    name: lb-{{dns_shortname_suffix}}
    load_balancer_type: lb11
    location: fsn1
    state: present
  register: load_balancer
EXPECTED RESULTS

The load balancer will be created

ACTUAL RESULTS

Failed with Python traceback

TASK [hetzner-master : Create the main load balancer] **************************
task path: /home/vsts/work/1/s/roles/hetzner-master/tasks/main.yml:62
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: vsts
<127.0.0.1> EXEC /bin/sh -c 'echo ~vsts && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/vsts/.ansible/tmp `"&& mkdir "` echo /home/vsts/.ansible/tmp/ansible-tmp-1629878340.800816-2282-78190925982195 `" && echo ansible-tmp-1629878340.800816-2282-78190925982195="` echo /home/vsts/.ansible/tmp/ansible-tmp-1629878340.800816-2282-78190925982195 `" ) && sleep 0'
Using module file /home/vsts/.local/lib/python3.8/site-packages/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_load_balancer.py
<127.0.0.1> PUT /home/vsts/.ansible/tmp/ansible-local-1926w14howjl/tmpl12c18bc TO /home/vsts/.ansible/tmp/ansible-tmp-1629878340.800816-2282-78190925982195/AnsiballZ_hcloud_load_balancer.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/vsts/.ansible/tmp/ansible-tmp-1629878340.800816-2282-78190925982195/ /home/vsts/.ansible/tmp/ansible-tmp-1629878340.800816-2282-78190925982195/AnsiballZ_hcloud_load_balancer.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/vsts/.ansible/tmp/ansible-tmp-1629878340.800816-2282-78190925982195/AnsiballZ_hcloud_load_balancer.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/vsts/.ansible/tmp/ansible-tmp-1629878340.800816-2282-78190925982195/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/home/vsts/.ansible/tmp/ansible-tmp-1629878340.800816-2282-78190925982195/AnsiballZ_hcloud_load_balancer.py", line 102, in <module>
    _ansiballz_main()
  File "/home/vsts/.ansible/tmp/ansible-tmp-1629878340.800816-2282-78190925982195/AnsiballZ_hcloud_load_balancer.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/vsts/.ansible/tmp/ansible-tmp-1629878340.800816-2282-78190925982195/AnsiballZ_hcloud_load_balancer.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible_collections.hetzner.hcloud.plugins.modules.hcloud_load_balancer', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_hetzner.hcloud.hcloud_load_balancer_payload_st38147l/ansible_hetzner.hcloud.hcloud_load_balancer_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_load_balancer.py", line 323, in <module>
  File "/tmp/ansible_hetzner.hcloud.hcloud_load_balancer_payload_st38147l/ansible_hetzner.hcloud.hcloud_load_balancer_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_load_balancer.py", line 317, in main
  File "/tmp/ansible_hetzner.hcloud.hcloud_load_balancer_payload_st38147l/ansible_hetzner.hcloud.hcloud_load_balancer_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_load_balancer.py", line 268, in present_load_balancer
  File "/tmp/ansible_hetzner.hcloud.hcloud_load_balancer_payload_st38147l/ansible_hetzner.hcloud.hcloud_load_balancer_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_load_balancer.py", line 187, in _get_load_balancer
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
LKaemmerling commented 3 years ago

Hey @ondrejkolin,

please update your hcloud-python version to the latest release version: https://github.com/hetznercloud/hcloud-python/releases/tag/v1.16.0

ondrejkolin commented 3 years ago

@LKaemmerling Thanks for prompt reply, this indeed fixed my issue. Sorry for bothering with such a simple issue.

Good job on the tooling, pleasant to be using it :heart: