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_interface feature_flags not working #195

Open rodrigonascimento opened 6 months ago

rodrigonascimento commented 6 months ago

Summary

Trying to use the feature_flag parameter to create a LIF with rdma-protocol enabled, but the feature_flag shows up =null in the invocation log.

Component Name

na_ontap_interface

Ansible Version

$ ansible --version
ansible [core 2.15.4]
  config file = /root/.ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /root/.venv-ansible/lib64/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /root/.venv-ansible/bin/ansible
  python version = 3.9.18 (main, Sep  7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/root/.venv-ansible/bin/python3)
  jinja version = 3.1.2
  libyaml = True

ONTAP Collection Version

$ ansible-galaxy collection list | grep netapp.ontap
netapp.ontap                  22.8.3

ONTAP Version

sridharc-vsim34::> version
NetApp Release Clawhammer__9.14.1: Sun Oct 15 19:30:50 UTC 2023

Playbook

- name: Create data interface RDMA
      netapp.ontap.na_ontap_interface:
        state: present
        interface_name: "{{ item.lif_name }}"
        home_port: "{{ item.home_port }}"
        home_node: "{{ item.home_node }}"
        admin_status: up
        failover_scope: home_node_only
        service_policy: default-data-files
        is_auto_revert: true
        interface_type: ip
        address: "{{ item.address }}"
        netmask: "{{ item.netmask }}"
        feature_flags: {'rdma_protocols': "{{ item.rdma_protocols }}"}
        https: true
        validate_certs: false
        vserver: "{{ vserver }}"
        hostname: "{{ inventory_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ ntap_password }}"
      loop: "{{ nfs_lifs_rdma }}"

Steps to Reproduce

- name: Create data interface RDMA
      netapp.ontap.na_ontap_interface:
        state: present
        interface_name: "{{ item.lif_name }}"
        home_port: "{{ item.home_port }}"
        home_node: "{{ item.home_node }}"
        admin_status: up
        failover_scope: home_node_only
        service_policy: default-data-files
        is_auto_revert: true
        interface_type: ip
        address: "{{ item.address }}"
        netmask: "{{ item.netmask }}"
        feature_flags: {'rdma_protocols': "{{ item.rdma_protocols }}"}
        https: true
        validate_certs: false
        vserver: "{{ vserver }}"
        hostname: "{{ inventory_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ ntap_password }}"
      loop: "{{ nfs_lifs_rdma }}"

Expected Results

It should create a LIF with the flag rdma-protocol enabled.

Actual Results

"invocation": {
        "module_args": {
            "body": null,
            "cert_filepath": null,
            "command": "vserver/nfs",
            "feature_flags": null,
            "force_ontap_version": null,
            "hostname": "10.63.173.23",
            "http_port": null,
            "https": true,
            "key_filepath": null,
            "ontapi": null,
            "params": {
                "tcp-max-xfer-size": "1048576",
                "vserver": "vs_nvidia"
            },
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "use_rest": "auto",
            "username": "admin",
            "validate_certs": false,
            "verb": "OPTIONS"
        }
    },
    "msg": {
        "Allow": "GET, HEAD, OPTIONS, POST, DELETE, PATCH"
    }
carchi8py commented 6 months ago

@rodrigonascimento let me update the documentation to make this a clearer. feature_flags are things that are internal to our collection (like enabling tracing for apis, or header. https://github.com/ansible-collections/netapp.ontap/blob/97a7a5735ead4a5d49d3cb57e5fbfa01fe98058c/plugins/module_utils/netapp.py#L211

There not for features of a specific module.

i will add a story though to add this to this option to the interface module.

carchi8py commented 6 months ago

I have story DEVOPS-6583 open this