netascode / ansible-dc-vxlan

Ansible Collection for configuring a VXLAN Fabric using Direct to Controller (DTC) or Direct To Device (DTD) workflows.
https://galaxy.ansible.com/ui/repo/published/cisco/nac_dc_vxlan/
MIT License
6 stars 8 forks source link

Use dcnm_link to prepare interfaces for vpc peering #80

Closed mikewiebe closed 5 months ago

mikewiebe commented 5 months ago
          I would prefer we use the interface module `query` state to get the status of these interfaces and loop until it reaches the desired state.

Here is an example using the network module (of course use the dcnm_interface module instead)

https://github.com/CiscoDevNet/ansible-dcnm/blob/develop/tests/integration/targets/dcnm_network/tests/dcnm/replaced.yaml#L58

- name: Query Interface State
  cisco.dcnm.dcnm_interface:
    fabric: "{{ test_fabric }}"
    state: query
    config:
      - name: "{{ ansible_eth_intf2 }}"
         switch:
            - "{{ ansible_switch1 }}" 
  register: query_result
  until:
    - "query_result.response[0] .... Some condition here.... "
    - "query_result.response[1] .... Some condition here ..."
  retries: 30
  delay: 2

_Originally posted by @mikewiebe in https://github.com/netascode/ansible-dc-vxlan/pull/74#discussion_r1578039887_

mikewiebe commented 5 months ago

Additional items to explore

devegupt commented 5 months ago

Merged so closing this.