summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_bgp_address_family/tests/cli/overridden.yaml
blob: 94144940eb279598360efae2a9c38b2fa0a5f697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- debug:
    msg:
      START vyos_bgp_address_family overridden integration tests on connection={{
      ansible_connection }}

- include_tasks: _populate.yaml

- block:
    - name: Replace the existing configuration with the provided running configuration
      register: result
      vyos.vyos.vyos_bgp_address_family: &id001
        config:
          as_number: "65536"
          address_family:
            - afi: "ipv6"
              redistribute:
                - protocol: "static"
                  metric: 50
          neighbors:
            - neighbor_address: "203.0.113.5"
              address_family:
                - afi: "ipv6"
                  allowas_in: 4
                  attribute_unchanged:
                    med: true
                  default_originate: "map01"
                  distribute_list:
                    - action: "export"
                      acl: 10
        state: overridden

    - vyos.vyos.vyos_facts:
        gather_network_resources: bgp_address_family

    - assert:
        that:
          - result.commands|length == 10
          - result.changed == true
          - result.commands|symmetric_difference(overridden.commands) == []
          - result.after == ansible_facts['network_resources']['bgp_address_family']

    - name:
        Replace the existing configuration with the provided running configuration
        (IDEMPOTENT)
      register: result
      vyos.vyos.vyos_bgp_address_family: *id001

    - name: Assert that the previous task was idempotent
      assert:
        that:
          - result['changed'] == false

  always:
    - include_tasks: _remove_config.yaml