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

- include_tasks: _remove_config.yaml

- block:
    - name: Round Trip test by applying the provided configuration (base config)
      iosxr_l3_interfaces:
        config:
          - name: GigabitEthernet0/0/0/0
            ipv4:
            - address: 198.51.100.1/24
          - name: GigabitEthernet0/0/0/1
            ipv6:
            - address: 2001:db8:0:3::/64
            ipv4:
            - address: 192.0.2.1/24
            - secondary: True
              address: 192.0.2.2/24
        state: merged
      register: base_config

    - name: Gather interfaces facts
      iosxr_facts:
        gather_subset:
          - default
        gather_network_resources:
          - l3_interfaces
      register: l3facts_config

    - name: Apply config from l3_interfaces facts generated (IDEMPOTENT)
      iosxr_l3_interfaces:
        config: "{{ l3facts_config['ansible_facts']['ansible_network_resources']['l3_interfaces'] }}"
        state: merged

  always:
    - include_tasks: _remove_config.yaml