<commit_before>---
- debug: msg="START connection={{ ansible_connection }} nxos_vxlan_vtep_vni sanity test"
- debug: msg="Using provider={{ connection.transport }}"
  when: ansible_connection == "local"

- block:
  - name: "Apply N7K specific setup config"
    include: targets/nxos_vxlan_vtep/tasks/platform/n7k/setup.yaml
    when: platform is match('N7K')

  - name: "Enable feature nv overlay"
    nxos_config: 
      commands:
        - feature nv overlay
      provider: "{{ connection }}"
      match: none

  - name: configure vxlan_vtep
    nxos_vxlan_vtep:
      interface: nve1
      host_reachability: True
      provider: "{{ connection }}"

  - name: configure vxlan_vtep_vni assoc-vrf
    nxos_vxlan_vtep_vni: &conf1
      interface: nve1
      vni: 6000
      assoc_vrf: True
      provider: "{{ connection }}"
    register: result

  - assert: &true
      that:
        - "result.changed == true"

  - name: "Conf 1 Idempotence"
    nxos_vxlan_vtep_vni: *conf1
    register: result

  - assert: &false
      that:
        - "result.changed == false"

  - name: remove vxlan_vtep_vni
    nxos_vxlan_vtep_vni:
      interface: nve1
      vni: 6000
      assoc_vrf: True
      state: absent
      provider: "{{ connection }}"

  - name: configure vxlan_vtep_vni
    nxos_vxlan_vtep_vni: &conf2
      interface: nve1
      vni: 8000
      provider: "{{ connection }}"
    register: result

  - assert: *true

  - name: configure vxlan_vtep_vni mcast
    nxos_vxlan_vtep_vni: &conf3
      interface: nve1
      vni: 8000
      multicast_group: 192.168.127.12
      provider: "{{ connection }}"
    register: result

  - assert: *true

  - name: "Conf 3 Idempotence"
    nxos_vxlan_vtep_vni: *conf3
    register: result

  - assert: *false

  - name: configure vxlan_vtep_vni default mcast
    nxos_vxlan_vtep_vni: &conf4
      interface: nve1
      vni: 8000
      multicast_group: default
      provider: "{{ connection }}"
    register: result

  - assert: *true

  - name: "Conf 4 Idempotence"
    nxos_vxlan_vtep_vni: *conf4
    register: result

  - assert: *false

  - name: "remove config"
    nxos_vxlan_vtep_vni: &remove
      interface: nve1
      vni: 8000
      state: absent
      provider: "{{ connection }}"

  - name: configure vxlan_vtep
    nxos_vxlan_vtep:
      interface: nve1
      host_reachability: False
      provider: "{{ connection }}"

  - block:
    - name: configure vxlan_vtep_vni
      nxos_vxlan_vtep_vni: &conf5
        interface: nve1
        vni: 8000
        provider: "{{ connection }}"
      register: result
  
    - assert: *true

    - name: configure vxlan_vtep_vni ingress static
      nxos_vxlan_vtep_vni: &conf6
        interface: nve1
        vni: 8000
        ingress_replication: static
        provider: "{{ connection }}"
      register: result
  
    - assert: *true

    - name: "Conf 6 Idempotence"
      nxos_vxlan_vtep_vni: *conf6
      register: result

    - assert: *false

    - name: configure vxlan_vtep_vni ingress bgp
      nxos_vxlan_vtep_vni: &conf7
        interface: nve1
        vni: 8000
        ingress_replication: bgp
        provider: "{{ connection }}"
      register: result
  
    - assert: *true

    - name: "Conf 7 Idempotence"
      nxos_vxlan_vtep_vni: *conf7
      register: result

    - assert: *false

    - name: remove ingress_repl
      nxos_vxlan_vtep_vni: &conf8
        interface: nve1
        vni: 8000
        ingress_replication: default
        provider: "{{ connection }}"
      register: result
  
    - assert: *true

    - name: "Conf 8 Idempotence"
      nxos_vxlan_vtep_vni: *conf8
      register: result

    - assert: *false

    - name: configure vxlan_vtep_vni peer-list
      nxos_vxlan_vtep_vni: &conf9
        interface: nve1
        vni: 8000
        peer_list: 
          - 1.1.1.1
          - 2.2.2.2
          - 3.3.3.3
          - 4.4.4.4
        ingress_replication: static
        provider: "{{ connection }}"
      register: result
  
    - assert: *true

    - name: "Conf 9 Idempotence"
      nxos_vxlan_vtep_vni: *conf9<commit_msg>Fix vxlan_vtep_vni tests (#39968)<commit_after>---
- debug: msg="START connection={{ ansible_connection }} nxos_vxlan_vtep_vni sanity test"
- debug: msg="Using provider={{ connection.transport }}"
  when: ansible_connection == "local"

- block:
  - name: "Apply N7K specific setup config"
    include: targets/nxos_vxlan_vtep/tasks/platform/n7k/setup.yaml
    when: platform is match('N7K')

  - name: "Enable feature nv overlay"
    nxos_config: 
      commands:
        - feature nv overlay
      provider: "{{ connection }}"
      match: none

  - name: configure vxlan_vtep
    nxos_vxlan_vtep:
      interface: nve1
      host_reachability: True
      provider: "{{ connection }}"

  - name: configure vxlan_vtep_vni assoc-vrf
    nxos_vxlan_vtep_vni: &conf1
      interface: nve1
      vni: 6000
      assoc_vrf: True
      provider: "{{ connection }}"
    register: result

  - assert: &true
      that:
        - "result.changed == true"

  - name: "Conf 1 Idempotence"
    nxos_vxlan_vtep_vni: *conf1
    register: result

  - assert: &false
      that:
        - "result.changed == false"

  - name: remove vxlan_vtep_vni
    nxos_vxlan_vtep_vni:
      interface: nve1
      vni: 6000
      assoc_vrf: True
      state: absent
      provider: "{{ connection }}"

  - name: configure vxlan_vtep_vni
    nxos_vxlan_vtep_vni: &conf2
      interface: nve1
      vni: 8000
      provider: "{{ connection }}"
    register: result

  - assert: *true

  - name: configure vxlan_vtep_vni mcast
    nxos_vxlan_vtep_vni: &conf3
      interface: nve1
      vni: 8000
      multicast_group: 192.168.127.12
      provider: "{{ connection }}"
    register: result

  - assert: *true

  - name: "Conf 3 Idempotence"
    nxos_vxlan_vtep_vni: *conf3
    register: result

  - assert: *false

  - name: configure vxlan_vtep_vni default mcast
    nxos_vxlan_vtep_vni: &conf4
      interface: nve1
      vni: 8000
      multicast_group: default
      provider: "{{ connection }}"
    register: result

  - assert: *true

  - name: "Conf 4 Idempotence"
    nxos_vxlan_vtep_vni: *conf4
    register: result

  - assert: *false

  - name: "remove config"
    nxos_vxlan_vtep_vni: &remove
      interface: nve1
      vni: 8000
      state: absent
      provider: "{{ connection }}"

  - name: configure vxlan_vtep
    nxos_vxlan_vtep:
      interface: nve1
      host_reachability: False
      provider: "{{ connection }}"

  - block:
    - name: configure vxlan_vtep_vni
      nxos_vxlan_vtep_vni: &conf5
        interface: nve1
        vni: 8000
        provider: "{{ connection }}"
      register: result
  
    - assert: *true

    - name: configure vxlan_vtep_vni ingress static
      nxos_vxlan_vtep_vni: &conf6
        interface: nve1
        vni: 8000
        ingress_replication: static
        provider: "{{ connection }}"
      register: result
  
    - assert: *true

    - name: check configure vxlan_vtep_vni ingress static idempotence check
      nxos_vxlan_vtep_vni: *conf6
      register: result

    - assert: *false

    - name: Remove and reconfigure vxlan_vtep
      nxos_vxlan_vtep: &remove_vtep
        interface: nve1
        state: absent
        provider: "{{ connection }}"

    - name: Configure vxlan_vtep with host reachability bgp
      nxos_vxlan_vtep:
        interface: nve1
        host_reachability: True
        provider: "{{ connection }}"

    - name: configure vxlan_vtep_vni
      nxos_vxlan_vtep_vni: &config_vni
        interface: nve1
        vni: 8000
        provider: "{{ connection }}"

    - name: configure vxlan_vtep_vni ingress bgp
      nxos_vxlan_vtep_vni: &conf7
        interface: nve1
        vni: 8000
        ingress_replication: bgp
        provider: "{{ connection }}"
      register: result
  
    - assert: *true

    - name: "Conf 7 Idempotence"
      nxos_vxlan_vtep_vni: *conf7
      register: result

    - assert: *false

    - name: remove ingress_repl
      nxos_vxlan_vtep_vni: &conf8
        interface: nve1
        vni: 8000
        ingress_replication: default
        provider: "{{ connection }}"
      register: result
  
    - assert: *true

    - name: "Conf 8 Idempotence"
      nxos_vxlan_vtep_vni: *conf8
      register: result

    - assert: *false

    - name: Remove and reconfigure vxlan_vtep
      nxos_vxlan_vtep: *remove_vtep

    - name: Configure vxlan_vtep with host reachability static
      nxos_vxlan_vtep:
        interface: nve1
        host_reachability: False
        provider: "{{ connection }}"

    - name: configure vxlan_vtep_vni
      nxos_vxlan_vtep_vni: *config_vni

    - name: configure vxlan_vtep_vni peer-list
      nxos_vxlan_vtep_vni: &conf9
        interface: nve1
        vni: 8000
        peer_list: 
          - 1.1.1.1
          - 2.2.2.2
          - 3.3.3.3
          - 4.4.4.4
        ingress_replication: static
        provider: "{{ connection }}"
      register: result
  
    - assert: *true

    - name: "Conf 9 Idempotence"
      nxos_vxlan_vtep_vni: *conf9
{'fraction_non_alphanumeric': 0.09135200974421437, 'fraction_numerical': 0.02568929243716089, 'mean_word_length': 2.2489208633093525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 10, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2016222', 'n_tokens_mistral': 3547, 'n_tokens_neox': 3244, 'n_words': 720}