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

nsxt_cluster_profiles.py is not idempotent #450

Open
eschek87 opened this issue Nov 9, 2022 · 0 comments
Open

nsxt_cluster_profiles.py is not idempotent #450

eschek87 opened this issue Nov 9, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@eschek87
Copy link

eschek87 commented Nov 9, 2022

Describe the bug

- name: Create Edge Cluster Profiles
  vmware.ansible_for_nsxt.nsxt_cluster_profiles:
    hostname: "{{ manager_node1_ip }}"
    username: "{{ manager_username }}"
    password: "{{ manager_password }}"
    validate_certs: "{{ validate_certs }}"
    resource_type: EdgeHighAvailabilityProfile
    display_name: "{{ edge_transport_nodes_global['cluster_profile_name'] }}"
    bfd_probe_interval: 500
    bfd_declare_dead_multiple: 3
    bfd_allowed_hops: 255
    standby_relocation_config:
      standby_relocation_threshold: 30
    state: present

Error message when the profile exist:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: 'int' object is not iterable
fatal: [127.0.0.1]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File "/root/.ansible/tmp/ansible-tmp-1667980534.7133691-263-230372837113664/AnsiballZ_nsxt_cluster_profiles.py", line 107, in \n _ansiballz_main()\n File "/root/.ansible/tmp/ansible-tmp-1667980534.7133691-263-230372837113664/AnsiballZ_nsxt_cluster_profiles.py", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/root/.ansible/tmp/ansible-tmp-1667980534.7133691-263-230372837113664/AnsiballZ_nsxt_cluster_profiles.py", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.vmware.ansible_for_nsxt.plugins.modules.nsxt_cluster_profiles', init_globals=dict(_module_fqn='ansible_collections.vmware.ansible_for_nsxt.plugins.modules.nsxt_cluster_profiles', _modlib_path=modlib_path),\n File "/usr/lib64/python3.8/runpy.py", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File "/usr/lib64/python3.8/runpy.py", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code\n exec(code, run_globals)\n File "/tmp/ansible_vmware.ansible_for_nsxt.nsxt_cluster_profiles_payload_xwgr4u_i/ansible_vmware.ansible_for_nsxt.nsxt_cluster_profiles_payload.zip/ansible_collections/vmware/ansible_for_nsxt/plugins/modules/nsxt_cluster_profiles.py", line 277, in \n File "/tmp/ansible_vmware.ansible_for_nsxt.nsxt_cluster_profiles_payload_xwgr4u_i/ansible_vmware.ansible_for_nsxt.nsxt_cluster_profiles_payload.zip/ansible_collections/vmware/ansible_for_nsxt/plugins/modules/nsxt_cluster_profiles.py", line 229, in main\n File "/tmp/ansible_vmware.ansible_for_nsxt.nsxt_cluster_profiles_payload_xwgr4u_i/ansible_vmware.ansible_for_nsxt.nsxt_cluster_profiles_payload.zip/ansible_collections/vmware/ansible_for_nsxt/plugins/modules/nsxt_cluster_profiles.py", line 176, in check_for_update\n File "/tmp/ansible_vmware.ansible_for_nsxt.nsxt_cluster_profiles_payload_xwgr4u_i/ansible_vmware.ansible_for_nsxt.nsxt_cluster_profiles_payload.zip/ansible_collections/vmware/ansible_for_nsxt/plugins/modules/nsxt_cluster_profiles.py", line 123, in cmp_dict\nTypeError: 'int' object is not iterable\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Reproduction steps

Run the module/task 2 times

Expected behavior

Module should retunr with ok - nothing to change

Additional context

No response

@eschek87 eschek87 added the bug Something isn't working label Nov 9, 2022
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

1 participant