ansible-for-nsxt icon indicating copy to clipboard operation
ansible-for-nsxt copied to clipboard

nsxt_local_managers_compatibility: Thumbprint argument

Open luischanu opened this issue 3 years ago • 0 comments

Hello,

As shown below, the documentation within the nsxt_local_managers_compatibility.py module indicates that the site_connection_info thumbprint option is not a required field, yet it seems to be required. It's unclear to me if this is just an error in the documentation, or truly an issue with the module. Here is the documentation snip from the module:

    site_connection_info:
        fqdn:
            description: 'IP address or hostname of local manager'
            required: true
            type: str
        password:
            description: "Password for the user"
            no_log: 'True'
            required: false
            type: str
        required: false
        thumbprint:
            description: 'Thumbprint of local manager in the form of a SHA-256 hash represented in lower case HEX'
            no_log: 'True'
            required: false
            type: str
        username:
            description: 'Username value of the local manager'
            required: false
            type: str

However, when I try to perform the following task without the thumbprint argument:

    - name: Verify NSX-T Local Manager is compatible with NSX-T Global Manager
      nsxt_local_managers_compatibility:
        hostname: "{{ Nested_NSXT.Components.GlobalManager_VIP.FQDN }}"
        username: "{{ Nested_NSXT.Credential.admin.Name }}"
        password: "{{ Nested_NSXT.Credential.admin.Password }}"
        validate_certs: False
        site_connection_info:
          fqdn: "{{ Nested_NSXT.Components.LocalManager_VIP.FQDN }}"
          username: "{{ Nested_NSXT.Credential.admin.Name }}"
          password: "{{ Nested_NSXT.Credential.admin.Password }}"

...it fails with the following message:

TASK [Verify NSX-T Local Manager is compatible with NSX-T Global Manager] **********************************************************************************************************
Tuesday 24 August 2021  23:16:41 -0700 (0:00:00.641)       0:00:05.786 ******** 
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error accessing local manager. Error [(530045, {'httpStatus': 'BAD_REQUEST', 'error_code': 530045, 'module_name': 'Policy', 'error_message': 'Site connection info missing required attributes - FQDN or User Name or Thumbprint or Password'})]"}

When I include the thumbprint within the site_connection_info section, the command completes successfully. Here is the updated task with the thumbprint, and it completes without issue:

    - name: Verify NSX-T Local Manager is compatible with NSX-T Global Manager
      nsxt_local_managers_compatibility:
        hostname: "{{ Nested_NSXT.Components.GlobalManager_VIP.FQDN }}"
        username: "{{ Nested_NSXT.Credential.admin.Name }}"
        password: "{{ Nested_NSXT.Credential.admin.Password }}"
        validate_certs: False
        site_connection_info:
          fqdn: "{{ Nested_NSXT.Components.LocalManager_VIP.FQDN }}"
          username: "{{ Nested_NSXT.Credential.admin.Name }}"
          password: "{{ Nested_NSXT.Credential.admin.Password }}"
          thumbprint: 6e281fa134b6418edcf19618783f34d552d79db49e04df9503a7c280ad2bffdc

Additionally, I run into the same issue with the nsxt_local_manager_registration.py module as well.

Test Environment:

  • NSX-T Local Manager: v3.1.3
  • NSX-T Global Manager: v3.1.3

Thank you.

Luis

luischanu avatar Aug 25 '21 06:08 luischanu