ansible-collections / netapp.ontap

Ansible collection to support NetApp ONTAP configuration.
https://galaxy.ansible.com/netapp/ontap
GNU General Public License v3.0
51 stars 34 forks source link

na_ontap_rest_info : gather wrong number of aggregates #168

Closed dginhoux closed 5 months ago

dginhoux commented 11 months ago

Summary

Hi,

I use 2 netapp nodes and this ansible module lost 1 aggr per node. Here :

Component Name

netapp.ontap.na_ontap_rest_info

Ansible Version

2.15.1

ONTAP Collection Version

22.7.0

ONTAP Version

9.10.1P11

Playbook

vars:
    storage_node:
      - name: nas-03
        host: 10.1.0.3
        port: 443
        username: admin
        password: "123456"

      - name: nas-02
        host: 10.1.0.2
        port: 443
        username: admin
        password: "123456"

  tasks:
    - name: Netapp query informations
      register: netapp_info
      loop: "{{ storage_node | flatten }}"
      loop_control:
        loop_var: node 
      netapp.ontap.na_ontap_rest_info:
        hostname: "{{ node.host }}"
        http_port: "{{ node.port }}"
        username: "{{ node.username }}"
        password: "{{ node.password }}"
        use_rest: always
        https: true
        validate_certs: false
        gather_subset:
          - storage/aggregates

    - debug:
        var: netapp_info

Steps to Reproduce

run a playbook with this module and gather "storage/aggregates"

Expected Results

nas-02::> aggr show -fields aggregate 
aggregate       
--------------- 
aggr0_nas_02_01 
aggr1_nas_02_01 
aggr2_nas_02_01 
3 entries were displayed.
nas-03::> aggr show -fields aggregate 
aggregate       
--------------- 
aggr0_nas_03_01 
aggr1_nas_03_01 
2 entries were displayed.

Actual Results

nas-02 : 

                "ontap_info": {
                    "storage/aggregates": {
                        "_links": {
                            "self": {
                                "href": "/api/storage/aggregates?max_records=1024&fields="
                            }
                        },
                        "num_records": 2,
                        "records": [
                            {
                                "_links": {
                                    "self": {
                                        "href": "/api/storage/aggregates/6bd5f2ec-b096-414c-9783-77c6f9bd11e2"
                                    }
                                },
                                "name": "aggr2_nas_02_01",
                                "uuid": "6bd5f2ec-b096-414c-9783-77c6f9bd11e2"
                            },
                            {
                                "_links": {
                                    "self": {
                                        "href": "/api/storage/aggregates/7878a6ef-a770-4697-9b56-5fe8022e1094"
                                    }
                                },
                                "name": "aggr1_nas_02_01",
                                "uuid": "7878a6ef-a770-4697-9b56-5fe8022e1094"

nas-03 :

"ontap_info": {
                    "storage/aggregates": {
                        "_links": {
                            "self": {
                                "href": "/api/storage/aggregates?max_records=1024&fields="
                            }
                        },
                        "num_records": 1,
                        "records": [
                            {
                                "_links": {
                                    "self": {
                                        "href": "/api/storage/aggregates/cf2f97b1-09c9-4863-93af-e9ebd5b38f81"
                                    }
                                },
                                "name": "aggr1_nas_03_01",
                                "uuid": "cf2f97b1-09c9-4863-93af-e9ebd5b38f81"
carchi8py commented 11 months ago

You will want to go here https://netapp.io/ and join discord and reach out to the rest api team. The results we are returning are unfiltered results from the rest api