ansible-collections / mellanox.onyx

onyx
GNU General Public License v3.0
10 stars 14 forks source link

onyx_linkagg and vlan not working in MLAG setup (master/standby) #21

Open thizmo opened 2 years ago

thizmo commented 2 years ago
SUMMARY

Dear all,

i am using the onyx_linkagg and onyx_vlan for configuring our switches in an HA-Setup (MLAG)

Two pairs of switches are connected via mlag. See

show mlag-vip 

MLAG-VIP:
 MLAG group name: my-mlag-vip-mlnx2
 MLAG VIP address: 10.x.x.60/24
 Active nodes: 2

----------------------------------------------------------------------------------
Hostname                                 VIP-State            IP Address          
----------------------------------------------------------------------------------
mlnx21                 master                10.x.x.61          
mlnx22                 standby              10.x.x.62      

The systems were setuped manually (one by one with ena, conf t etc.) by another company.

We now have to change a lot an i do not want to do that manually.

When i try my task

 - name: Remove aggregate of linkagg definitions
      onyx_linkagg:
        aggregate:
          - name: Mpo3
          - name: Mpo4
        state: absent
      tags: mpo-config

The output is always the same:

PLAY [MLNX] ****************************************************************************************************************************************************

TASK [Remove aggregate of linkagg definitions] *****************************************************************************************************************
fatal: [mlnx22]: FAILED! => {"changed": false, "msg": "No JSON object could be decoded"}
ok: [mlnx21]

PLAY RECAP *****************************************************************************************************************************************************
mlnx21                     : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
mlnx22                     : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0 

This always happens on the standby node.

A traceback may give some more hints:

The full traceback is:

WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_onyx_linkagg_payload_fBJ3M_/ansible_onyx_linkagg_payload.zip/ansible_collections/mellanox/onyx/plugins/module_utils/network/onyx/onyx.py", line 158, in get_capabilities
    capabilities = connection.get_capabilities()
  File "/tmp/ansible_onyx_linkagg_payload_fBJ3M_/ansible_onyx_linkagg_payload.zip/ansible/module_utils/connection.py", line 190, in __rpc__
    raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
fatal: [mlnx22]: FAILED! => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "aggregate": [
                {
                    "members": null, 
                    "mode": "on", 
                    "name": "Mpo3", 
                    "state": "absent"
                }, 
                {
                    "members": null, 
                    "mode": "on", 
                    "name": "Mpo4", 
                    "state": "absent"
                }
            ], 
            "members": null, 
            "mode": "on", 
            "name": null, 
            "purge": false, 
            "state": "absent"
        }
    }, 
    "msg": "No JSON object could be decoded"
}

The playbook loops like this:

- hosts: MLNX
  connection: network_cli
  become: yes
  become_method: enable

  collections:
    - mellanox.onyx

  tasks:
SUMMARY

Seems to me, the standby node can't be updated in this scenario with ansible modules

The same is true for the onyx_vlan modul. Same behavior.

ISSUE TYPE
COMPONENT NAME
ONYX Version
Product name:      Onyx
Product release:   3.9.2110
ANSIBLE VERSION
ansible 2.9.27
  config file = .ansible.cfg
  configured module search path = [u'/usr/share/ansible']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.12 (default, Mar  1 2021, 11:38:31) [GCC 5.4.0 20160609]
mariolenz commented 1 year ago

This collection is currently unmaintained, so nobody will work on your issue. See ansible-community/community-topics#136 for more information.

If you're interested in mainting this collection yourself, please read the maintainer guidelines and let us know if you want to take over on Matrix: #community:ansible.com or on irc.libera.chat: #ansible-community.