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

Can not remove members in a PEER-Zone #163

Open
MMarceLL123 opened this issue Oct 22, 2024 · 1 comment
Open

Can not remove members in a PEER-Zone #163

MMarceLL123 opened this issue Oct 22, 2024 · 1 comment

Comments

@MMarceLL123
Copy link

MMarceLL123 commented Oct 22, 2024

Hi,
I'm getting desperate...

I want to delete a WWPN from a PEER zone. Unfortunately and always get an error message.


  - name: SAN Switch ALIAS kill from PEER-Zone
    vars:
      credential:
        fos_ip_addr: "{{ brocade_switches }}"
        fos_user_name: "{{fos_user_name}}"
        fos_password: "{{fos_password}}"
        https: "{{fos_https}}"
      zones:
        - name: "PEERZONE_HOSTS_TO_STORAGE_x_y"
          members:
          - "10:10:10:10:10:10:10:10"
    brocade.fos.brocade_zoning_zone:
      credential: "{{credential}}"
      vfid: -1
      zones: "{{ zones }}"
      members_remove_only: true
    register: zone_remove
    ignore_errors: true


Errormessage:

TypeError: can only concatenate str (not "list") to str

The full traceback is:
Traceback (most recent call last):
File "/home/xxx/.ansible/tmp/ansible-tmp-1729600483.5203335-15320-242886596534194/AnsiballZ_brocade_zoning_zone.py", line 107, in
_ansiballz_main()
File "/home/xxx/.ansible/tmp/ansible-tmp-1729600483.5203335-15320-242886596534194/AnsiballZ_brocade_zoning_zone.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/xxx/.ansible/tmp/ansible-tmp-1729600483.5203335-15320-242886596534194/AnsiballZ_brocade_zoning_zone.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible_collections.brocade.fos.plugins.modules.brocade_zoning_zone', init_globals=dict(_module_fqn='ansible_collections.brocade.fos.plugins.modules.brocade_zoning_zone', _modlib_path=modlib_path),
File "/usr/lib/python3.10/runpy.py", line 224, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/tmp/ansible_brocade.fos.brocade_zoning_zone_payload_cn4xjzf7/ansible_brocade.fos.brocade_zoning_zone_payload.zip/ansible_collections/brocade/fos/plugins/modules/brocade_zoning_zone.py", line 225, in
File "/tmp/ansible_brocade.fos.brocade_zoning_zone_payload_cn4xjzf7/ansible_brocade.fos.brocade_zoning_zone_payload.zip/ansible_collections/brocade/fos/plugins/modules/brocade_zoning_zone.py", line 209, in main
File "/tmp/ansible_brocade.fos.brocade_zoning_zone_payload_cn4xjzf7/ansible_brocade.fos.brocade_zoning_zone_payload.zip/ansible_collections/brocade/fos/plugins/module_utils/brocade_connection.py", line 47, in login
File "/tmp/ansible_brocade.fos.brocade_zoning_zone_payload_cn4xjzf7/ansible_brocade.fos.brocade_zoning_zone_payload.zip/ansible_collections/brocade/fos/plugins/module_utils/brocade_url.py", line 41, in full_url_get
TypeError: can only concatenate str (not "list") to str
fatal: [hostnamem]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):

File "/home/xxx/.ansible/tmp/ansible-tmp-1729600483.5203335-15320-242886596534194/AnsiballZ_brocade_zoning_zone.py", line 107, in _ansiballz_main()

File "/home/xxx/.ansible/tmp/ansible-tmp-1729600483.5203335-15320-242886596534194/AnsiballZ_brocade_zoning_zone.py", line 99, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)

File "/home/xxx/.ansible/tmp/ansible-tmp-1729600483.5203335-15320-242886596534194/AnsiballZ_brocade_zoning_zone.py", line 47, in invoke_module

runpy.run_module(mod_name='ansible_collections.brocade.fos.plugins.modules.brocade_zoning_zone, init_globals=dict(_module_fqn='ansible_collections.brocade.fos.plugins.modules.brocade_zoning_zone, _modlib_path=modlib_path),

File "/usr/lib/python3.10/runpy.py", line 224, in run_module

return _run_module_code(code, init_globals, run_name, mod_spec)

File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code_run_code(code, mod_globals, init_globals,

File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals)

File"/tmp/ansible_brocade.fos.brocade_zoning_zone_payload_cn4xjzf7/ansible_brocade.fos.brocade_zoning_zone_payload.zip/ansible_collections/brocade/fos/plugins/modules/brocade_zoning_zone.py", line 225, in

File "/tmp/ansible_brocade.fos.brocade_zoning_zone_payload_cn4xjzf7/ansible_brocade.fos.brocade_zoning_zone_payload.zip/ansible_collections/brocade/fos/plugins/modules/brocade_zoning_zone.py", line 209, in main

File "/tmp/ansible_brocade.fos.brocade_zoning_zone_payload_cn4xjzf7/ansible_brocade.fos.brocade_zoning_zone_payload.zip/ansible_collections/brocade/fos/plugins/module_utils/brocade_connection.py", line 47, in login

File "/tmp/ansible_brocade.fos.brocade_zoning_zone_payload_cn4xjzf7/ansible_brocade.fos.brocade_zoning_zone_payload.zip/ansible_collections/brocade/fos/plugins/module_utils/brocade_url.py", line 41, in full_url_get

TypeError: can only concatenate str (not "list") to str","module_stdout": "", "msg": "MODULE FAILURE See stdout/stderr for the exact error",
"rc": 1
}

Versions:

$ ansible --version
ansible [core 2.16.0]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
ansible collection location = /home/xxx/.ansible/collections:/usr/share/ansible/collections
executable location = /bin/ansible
python version = 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True

$ ansible-galaxy collection list

/home/xxx/.ansible/collections/ansible_collections
Collection Version


ansible.posix 1.5.4
ansible.utils 5.0.0
ansible.windows 2.4.0
brocade.fos 1.3.4
community.vmware 3.7.0
dellemc.openmanage 9.5.0
dellemc.vxrail 2.4.0
ibm.storage_virtualize 2.4.1
mamoep.brocade_fos 1.0.0
vmware.ansible_for_nsxt 1.0.0

/usr/lib/python3/dist-packages/ansible_collections
Collection Version


amazon.aws 8.2.1
ansible.netcommon 6.1.3
ansible.posix 1.5.4
ansible.utils 4.1.0
ansible.windows 2.5.0
arista.eos 9.0.0
awx.awx 24.6.1
azure.azcollection 2.7.0
check_point.mgmt 5.2.3
chocolatey.chocolatey 1.5.3
cisco.aci 2.10.1
cisco.asa 5.0.1
cisco.dnac 6.20.0
cisco.intersight 2.0.20
cisco.ios 8.0.0
cisco.iosxr 9.0.0
cisco.ise 2.9.3
cisco.meraki 2.18.2
cisco.mso 2.9.0
cisco.nxos 8.1.0
cisco.ucs 1.14.0
cloud.common 3.0.0
cloudscale_ch.cloud 2.4.0
community.aws 8.0.0
community.ciscosmb 1.0.9
community.crypto 2.22.1
community.digitalocean 1.27.0
community.dns 3.0.5
community.docker 3.13.0
community.general 9.5.0
community.grafana 1.9.1
community.hashi_vault 6.2.0
community.hrobot 2.0.2
community.library_inventory_filtering_v1 1.0.1
community.libvirt 1.3.0
community.mongodb 1.7.7
community.mysql 3.10.3
community.network 5.0.3
community.okd 3.0.1
community.postgresql 3.6.1
community.proxysql 1.6.0
community.rabbitmq 1.3.0
community.routeros 2.19.0
community.sap_libs 1.4.2
community.sops 1.9.1
community.vmware 4.7.1
community.windows 2.3.0
community.zabbix 2.5.1
containers.podman 1.16.1
cyberark.conjur 1.3.0
cyberark.pas 1.0.27
dellemc.enterprise_sonic 2.5.1
dellemc.openmanage 9.7.0
dellemc.powerflex 2.5.0
dellemc.unity 2.0.0
f5networks.f5_modules 1.31.0
fortinet.fortimanager 2.7.0
fortinet.fortios 2.3.7
frr.frr 2.0.2
google.cloud 1.4.1
grafana.grafana 5.5.1
hetzner.hcloud 3.1.1
ibm.qradar 3.0.0
ibm.spectrum_virtualize 2.0.0
ibm.storage_virtualize 2.5.0
ieisystem.inmanage 2.0.0
infinidat.infinibox 1.4.5
infoblox.nios_modules 1.7.0
inspur.ispim 2.2.3
inspur.sm 2.3.0
junipernetworks.junos 8.0.0
kaytus.ksmanage 1.2.2
kubernetes.core 3.2.0
kubevirt.core 1.5.0
lowlydba.sqlserver 2.3.4
microsoft.ad 1.7.1
netapp.cloudmanager 21.22.1
netapp.ontap 22.12.0
netapp.storagegrid 21.12.0
netapp_eseries.santricity 1.4.1
netbox.netbox 3.20.0
ngine_io.cloudstack 2.5.0
ngine_io.exoscale 1.1.0
openstack.cloud 2.2.0
openvswitch.openvswitch 2.1.1
ovirt.ovirt 3.2.0
purestorage.flasharray 1.31.1
purestorage.flashblade 1.18.0
sensu.sensu_go 1.14.0
splunk.es 3.0.0
t_systems_mms.icinga_director 2.0.1
telekom_mms.icinga_director 2.1.2
theforeman.foreman 4.2.0
vmware.vmware 1.5.0
vmware.vmware_rest 3.2.0
vultr.cloud 1.13.0
vyos.vyos 4.1.0
wti.remote 1.0.10

@prasad-valmeti-broadcom
Copy link
Collaborator

  • hosts: san_eng_zone_seed_san_a
    gather_facts: False

This is to add members only:

vars:
credential:
fos_ip_addr: "{{fos_ip_addr}}"
fos_user_name: "{{fos_user_name}}"
fos_password: "{{fos_password}}"
https: "{{fos_https}}"
zones:
- name: Zone3
members:
- bb:99:99:99:99:99:99:99
principal_members:
- bb:bb:bb:bb:99:99:99:99

tasks:

  • name: add bb:99:99:99:99:99:99:99/bb:bb:bb:bb:99:99:99:99 to Zone3 by specifying the addition only and setting members_add_only to True
    brocade_zoning_zone:
    credential: "{{credential}}"
    vfid: -1
    members_add_only: True
    zones: "{{zones}}"

This playbook is to delete members only:

  • hosts: san_eng_zone_seed_san_a
    gather_facts: False

    vars:
    credential:
    fos_ip_addr: "{{fos_ip_addr}}"
    fos_user_name: "{{fos_user_name}}"
    fos_password: "{{fos_password}}"
    https: "{{fos_https}}"
    zones:
    - name: Zone3
    members:
    - bb:99:99:99:99:99:99:99
    principal_members:
    - bb:bb:bb:bb:99:99:99:99

    tasks:

    • name: after zoning_zone.yml, remove aa:44:44:44:44:44:44:44/aa:aa:aa:aa:bb:bb:bb:bb from Zone3 by specifying only those members being removed and setting members_remove_only to True
      brocade_zoning_zone:
      credential: "{{credential}}"
      vfid: -1
      members_remove_only: True
      zones: "{{zones}}"

I do see the members are getting deleted. Please try these examples and let us know if it works for your case.

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

2 participants