summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_lldp_global/tests/cli/rtt.yaml
blob: 2e8284f1681f9b09e00a84df015c0848416ea212 (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
---
- debug:
    msg: START vyos_lldp_global round trip integration tests on connection={{ ansible_connection
      }}

- include_tasks: _remove_config.yaml

- block:

    - name: Apply the provided configuration (base config)
      register: base_config
      vyos.vyos.vyos_lldp_global:
        config:
          legacy_protocols:
            - fdp
            - cdp
          address: 192.0.2.11
        state: merged

    - name: Gather vyos_lldp_global facts
      vyos.vyos.vyos_facts:
        gather_subset:
          - default
        gather_network_resources:
          - lldp_global

    - name: Apply the provided configuration (config to be reverted)
      register: result
      vyos.vyos.vyos_lldp_global:
        config:
          legacy_protocols:
            - edp
            - sonmp
            - cdp
          address: 192.0.2.14
        state: merged

    - name: Assert that changes were applied
      assert:
        that: "{{ round_trip['after'] == result['after'] }}"

    - name: Revert back to base config using facts round trip
      register: revert
      vyos.vyos.vyos_lldp_global:
        config: "{{ ansible_facts['network_resources']['lldp_global'] }}"
        state: replaced

    - name: Assert that config was reverted
      assert:
        that: "{{ base_config['after'] == revert['after'] }}"
  always:

    - include_tasks: _remove_config.yaml