#na_ontap_rest_cli

1 messages · Page 1 of 1 (latest)

limpid geyser
#

Hey guys I am trying to use na_ontap_rest_cli to run the command 'storage failover show', it is printing out only the node name but no other info.(As the image show)
Do I need to add any params to get the failover info?
I use this module because I don't see the related REST CLI in the rest api.
Here is my Ansible code:

  • name: "Getting storage failover info for {{ cluster_hostname }}"
    netapp.ontap.na_ontap_rest_cli:
    hostname: "{{ cluster_hostname }}"
    username: "{{ cluster_username }}"
    password: "{{ cluster_password }}"
    validate_certs: false
    command: 'storage/failover'
    verb: 'GET'
    register: storage_failover
  • name: ... Return storage failover data
    debug:
    msg: "{{ storage_failover }}"
long thistle
#

You can specifiy which fields to return.
params: fields: node,mode,partner-name

limpid geyser
#

@long thistle This doesn't work

#

Still seeing no response

long thistle
#

Fields that don't have values won't be returned. Everything else works like charm for me. Tested with ONTAP simulator running 9.11.1

`- netapp.ontap.na_ontap_rest_cli:
<<: *login
command: 'storage/failover'
verb: 'GET'
params:
fields: node,mode,ha-type,nvramid,state-description
register:
result

  • debug:
    var: result`

Result
ok: [localhost] => { "result": { "ansible_facts": { "discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": false, "failed": false, "msg": { "num_records": 1, "records": [ { "ha_type": "none", "mode": "non_ha", "node": "cluster-01", "nvramid": 4082368511, "state_description": "Non-HA mode" } ] } } }

sturdy trail
whole delta
#

@sturdy trail For idempotentcy to work correctly we have to hardcore any variable you want to set in to the module it self.

If there are variable that you need that are missing from a module.

You can make a Issue here https://github.com/ansible-collections/netapp.ontap and and we will added it in a future release.

GitHub

Ansible collection to support NetApp ONTAP configuration. - GitHub - ansible-collections/netapp.ontap: Ansible collection to support NetApp ONTAP configuration.