opentelekomcloud / ansible-collection-cloud

Ansible modules for using with OTC (addition to the native OpenStack modules)
Apache License 2.0
21 stars 14 forks source link

opentelekomcloud.cloud.loadbalancer - Error if using parameter public_ip_address #281

Open hadoopch opened 1 year ago

hadoopch commented 1 year ago

Hi all,

if i use the supported parameter:

in the loabbalancer module. I got the following error:

The full traceback is:
Traceback (most recent call last):
  File "/home/linux/.ansible/tmp/ansible-tmp-1687768980.49892-10751-52318687424828/AnsiballZ_loadbalancer.py", line 107, in <module>
    _ansiballz_main()
  File "/home/linux/.ansible/tmp/ansible-tmp-1687768980.49892-10751-52318687424828/AnsiballZ_loadbalancer.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/linux/.ansible/tmp/ansible-tmp-1687768980.49892-10751-52318687424828/AnsiballZ_loadbalancer.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.opentelekomcloud.cloud.plugins.modules.loadbalancer', init_globals=dict(_module_fqn='ansible_collections.opentelekomcloud.cloud.plugins.modules.loadbalancer', _modlib_path=modlib_path),
  File "/usr/local/lib/python3.8/runpy.py", line 206, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/local/lib/python3.8/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/local/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_opentelekomcloud.cloud.loadbalancer_payload_ihyko_dl/ansible_opentelekomcloud.cloud.loadbalancer_payload.zip/ansible_collections/opentelekomcloud/cloud/plugins/modules/loadbalancer.py", line 384, in <module>
  File "/tmp/ansible_opentelekomcloud.cloud.loadbalancer_payload_ihyko_dl/ansible_opentelekomcloud.cloud.loadbalancer_payload.zip/ansible_collections/opentelekomcloud/cloud/plugins/modules/loadbalancer.py", line 380, in main
  File "/tmp/ansible_opentelekomcloud.cloud.loadbalancer_payload_ihyko_dl/ansible_opentelekomcloud.cloud.loadbalancer_payload.zip/ansible_collections/opentelekomcloud/cloud/plugins/module_utils/otc.py", line 215, in __call__
  File "/tmp/ansible_opentelekomcloud.cloud.loadbalancer_payload_ihyko_dl/ansible_opentelekomcloud.cloud.loadbalancer_payload.zip/ansible_collections/opentelekomcloud/cloud/plugins/modules/loadbalancer.py", line 329, in run
  File "/tmp/ansible_opentelekomcloud.cloud.loadbalancer_payload_ihyko_dl/ansible_opentelekomcloud.cloud.loadbalancer_payload.zip/ansible_collections/opentelekomcloud/cloud/plugins/modules/loadbalancer.py", line 233, in bind_floating_ip
AttributeError: 'NoneType' object has no attribute 'floating_ip_address'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/linux/.ansible/tmp/ansible-tmp-1687768980.49892-10751-52318687424828/AnsiballZ_loadbalancer.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/linux/.ansible/tmp/ansible-tmp-1687768980.49892-10751-52318687424828/AnsiballZ_loadbalancer.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/linux/.ansible/tmp/ansible-tmp-1687768980.49892-10751-52318687424828/AnsiballZ_loadbalancer.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.opentelekomcloud.cloud.plugins.modules.loadbalancer', init_globals=dict(_module_fqn='ansible_collections.opentelekomcloud.cloud.plugins.modules.loadbalancer', _modlib_path=modlib_path),\n  File \"/usr/local/lib/python3.8/runpy.py\", line 206, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/local/lib/python3.8/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/local/lib/python3.8/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_opentelekomcloud.cloud.loadbalancer_payload_ihyko_dl/ansible_opentelekomcloud.cloud.loadbalancer_payload.zip/ansible_collections/opentelekomcloud/cloud/plugins/modules/loadbalancer.py\", line 384, in <module>\n  File \"/tmp/ansible_opentelekomcloud.cloud.loadbalancer_payload_ihyko_dl/ansible_opentelekomcloud.cloud.loadbalancer_payload.zip/ansible_collections/opentelekomcloud/cloud/plugins/modules/loadbalancer.py\", line 380, in main\n  File \"/tmp/ansible_opentelekomcloud.cloud.loadbalancer_payload_ihyko_dl/ansible_opentelekomcloud.cloud.loadbalancer_payload.zip/ansible_collections/opentelekomcloud/cloud/plugins/module_utils/otc.py\", line 215, in __call__\n  File \"/tmp/ansible_opentelekomcloud.cloud.loadbalancer_payload_ihyko_dl/ansible_opentelekomcloud.cloud.loadbalancer_payload.zip/ansible_collections/opentelekomcloud/cloud/plugins/modules/loadbalancer.py\", line 329, in run\n  File \"/tmp/ansible_opentelekomcloud.cloud.loadbalancer_payload_ihyko_dl/ansible_opentelekomcloud.cloud.loadbalancer_payload.zip/ansible_collections/opentelekomcloud/cloud/plugins/modules/loadbalancer.py\", line 233, in bind_floating_ip\nAttributeError: 'NoneType' object has no attribute 'floating_ip_address'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
Playbook is:

       - opentelekomcloud.cloud.loadbalancer:
            name: cdp-ELB-ext
            state: present
            vip_subnet: cdp-SN-pub
            public_ip_address: 185.153.107.136
            wait: true
            timeout: 600