summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_lag_interfaces/tests/cli/rendered.yaml
blob: 9892a3f14e06712478bff685fd6d23fb817abcce (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
---
- debug:
    msg: START vyos_lag_interfaces rendered integration tests on connection={{ ansible_connection
      }}

- include_tasks: _remove_config.yaml

- include_tasks: _populate.yaml

- block:

    - name: Structure provided configuration into device specific commands
      register: result
      vyos.vyos.vyos_lag_interfaces: &id001
        config:
          - name: bond0
            hash_policy: layer2
            members:
              - member: eth1
            mode: active-backup
            primary: eth1
          - name: bond1
            hash_policy: layer2+3
            members:
              - member: eth2
            mode: active-backup
            primary: eth2
        state: rendered

    - name: Assert that correct set of commands were generated
      assert:
        that:
          - "{{ rendered['commands'] | symmetric_difference(result['rendered'])\
            \ |length == 0 }}"

    - name: Structure provided configuration into device specific commands (IDEMPOTENT)
      register: result
      vyos.vyos.vyos_lag_interfaces: *id001

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

    - include_tasks: _remove_config.yaml