summaryrefslogtreecommitdiff
path: root/test/integration/targets/junos_static_routes/tests/netconf/deleted.yaml
blob: 78a9431b6908e67eb33d578f533c02cfa16be3b5 (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
---
- debug:
    msg: "START junos_static_routes deleted integration tests on connection={{ ansible_connection }}"

- include_tasks: _remove_config.yaml
- include_tasks: _base_config.yaml

- block:
    - name: Delete the provided configuration with the exisiting running configuration
      junos_static_routes: &deleted
        config:
          - address_families:
            - afi: 'ipv4'
            - afi: 'ipv6'
        state: deleted
      register: result

    - name: Assert the configuration is reflected on host
      assert:
        that:
          - not result.after
      debugger: on_failed

    - name: Delete the provided configuration with the existing running configuration (IDEMPOTENT)
      junos_static_routes: *deleted
      register: result

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

  always:
    - include_tasks: _remove_config.yaml

- debug:
    msg: "END junos_static_routes deleted integration tests on connection={{ ansible_connection }}"