brocade / ansible

55 stars 33 forks source link

How to change the active MAPS policy? #148

Open mgoetze5 opened 7 months ago

mgoetze5 commented 7 months ago

I tried to run this task

- name: Activate dflt_conservative_policy
  brocade.fos.brocade_maps_maps_policy:
    credential: "{{credential}}"
    vfid: "{{ default_vfid | default(-1) }}"
    maps_policies:
      - name: dflt_conservative_policy
        is_active_policy: True

and got this error

  "POST_resp_data": {
    "errors": {
      "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-restconf",
      "error": {
        "error-type": "protocol",
        "error-tag": "Operation-failed",
        "error-app-tag": "Error",
        "error-path": "/maps-policy/name/dflt_conservative_policy/",
        "error-message": "Policy is already present.",
        "error-info": {
          "error-code": "19",
          "error-module": "maps"
        }
      }
    }
  }

I believe the problem is that I need a PATCH operation, not a POST operation. How can I do this with ansible?

prasad-valmeti-broadcom commented 4 months ago

Please add all_entries as False, it will do the additive operation on the maps data instead of full db operation. Hope this resolves your issue.

prasad-valmeti-broadcom commented 4 months ago

If there are no further issues, please let us know if we can close this issue.