Uploaded image for project: 'Ansible Cloud Automation'
  1. Ansible Cloud Automation
  2. ACA-701

[vmware.vmware_rest/354] Filter_names not working as expected in vmware.vmware_rest.vcenter_network_info

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      https://github.com/ansible-collections/vmware.vmware_rest/issues/354

              1. SUMMARY
                Filter_names not working as expected in vmware.vmware_rest.vcenter_network_info
              1. ISSUE TYPE
                An unfiltered call to vmware.vmware_rest.vcenter_network_info returns the following

      `ok: [localhost] => {
      "network1_info": {
      "changed": false,
      "failed": false,
      "value": [

      { "name": "VM Network", "network": "network-3160", "type": "STANDARD_PORTGROUP" }

      ,

      { "name": "VM Network Private", "network": "network-3161", "type": "STANDARD_PORTGROUP" }

      ,

      { "name": "VM Network Public", "network": "network-3162", "type": "STANDARD_PORTGROUP" }

      ]
      }
      }
      `
      If I use the following

      ` - name: Get a list of the networks with a filter
      vmware.vmware_rest.vcenter_network_info:
      names:

      • "VM Network Public"
        register: network2_info
      • debug:
        var: network2_info
        `

      returns an empty list, rather than a list with a single entry.

              1. COMPONENT NAME
                vmware.vmware_rest.vcenter_network_info
              1. ANSIBLE VERSION
                <!--- Paste verbatim output from "ansible --version" between quotes -->
                ```
                nsible 2.10.8
                config file = None
                configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
                ansible python module location = /usr/lib/python3/dist-packages/ansible
                executable location = /usr/bin/ansible
                python version = 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]

      ```

              1. COLLECTION VERSION
                <!--- Paste verbatim output from "ansible-galaxy collection list <namespace>.<collection>" between the quotes
                for example: ansible-galaxy collection list community.general
                -->
                ```paste below
                vmware.vmware_rest 2.2.0
                ```
              1. CONFIGURATION
                <!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
                ```paste below

      ```

              1. OS / ENVIRONMENT
                <!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
              1. STEPS TO REPRODUCE
                <!--- Describe exactly how to reproduce the problem, using a minimal test-case -->

      <!--- Paste example playbooks or commands between quotes below -->
      ```yaml

      • name: Get a list of the networks with a filter
        vmware.vmware_rest.vcenter_network_info:
      1. filter_types: STANDARD_PORTGROUP
        names:
      • "VM Network Public"
        register: network2_info
      • debug:
        var: network2_info
        ```

      <!--- HINT: You can paste gist.github.com links for larger files -->

              1. EXPECTED RESULTS
                The returned list should have contained an entry that matched "VM Network Public", instead, it returned an empty list
              1. ACTUAL RESULTS
                <!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->

      <!--- Paste verbatim command output between quotes -->
      ```paste below

      ```

            Unassigned Unassigned
            jrouleau Jill Rouleau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: