Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrocluster Switchover -Simulate true #192

Closed
wagneradrian92 opened this issue Nov 27, 2023 · 2 comments
Closed

Metrocluster Switchover -Simulate true #192

wagneradrian92 opened this issue Nov 27, 2023 · 2 comments

Comments

@wagneradrian92
Copy link

Summary

when trying to simulate a metrocluster switchover simulte using netapp.ontap.na_ontap_rest_cli i use the following command:

command: 'metrocluster/switchover'
body:
action: negotiated_switchover_simulate
verb: PATCH

but i always receive the following error:
FAILED! => {"changed": false, "msg": "Error: {'message': 'Unexpected argument "action".', 'code': '262179', 'target': 'action'}"}

when doing the same call using curl it works. am i missing something in my task or is there a bug in this?

thank you

Component Name

netapp.ontap.na_ontap_rest_cli

Ansible Version

ansible            4.10.0
ansible-core       2.11.12

ONTAP Collection Version

netapp.aws                    21.7.0
netapp.azure                  21.10.0
netapp.cloudmanager           21.12.1
netapp.elementsw              21.7.0
netapp.ontap                  21.14.1
netapp.um_info                21.8.0
netapp_eseries.santricity     1.2.13

ONTAP Version

NetApp Release 9.11.1P6

Playbook

- name: Execute MetroCluster Switchover Simulation Command with rest
    netapp.ontap.na_ontap_rest_cli:
      hostname: "{{ inventory_hostname }}"
      username: "{{ ansible_username }}"
      password: "{{ ansible_password }}"
      #command: ['version']
      command: 'metrocluster/switchover'
      params:
        action: negotiated_switchover_simulate
      https: true
      validate_certs: false
      verb: PATCH

Steps to Reproduce

  - name: Execute MetroCluster Switchover Simulation Command with rest
    netapp.ontap.na_ontap_rest_cli:
      hostname: "{{ inventory_hostname }}"
      username: "{{ ansible_username }}"
      password: "{{ ansible_password }}"
      #command: ['version']
      command: 'metrocluster/switchover'
      params:
        action: negotiated_switchover_simulate
      https: true
      validate_certs: false
      verb: PATCH

Expected Results

switchover simulte successful or failed

Actual Results

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error: {'message': 'Unexpected argument \"action\".', 'code': '262179', 'target': 'action'}"}
@mamoep
Copy link

mamoep commented Nov 27, 2023

You are using the wrong module. na_ontap_rest_cli uses the private cli passthrough endpoint. This basically maps to CLI commands. The "metrocluster switchover" command has no parameter called "action".

You should use the module na_ontap_restit where you can directly access REST endpoints, similar to a curl command.
https://docs.ansible.com/ansible/devel/collections/netapp/ontap/na_ontap_restit_module.html

@wagneradrian92
Copy link
Author

thank you so much! with the restit module it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants