summaryrefslogtreecommitdiff
path: root/test/integration/targets/nxos_netconf/tasks/main.yaml
blob: 07e872c945875cdb602e2c606348c83ef2545ed9 (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
---
- name: Setup - Enable feature netconf
  nxos_feature:
    feature: netconf
    state: enabled
  vars: &ssh_credentials
    ansible_connection: network_cli
    ansible_ssh_port: 22
  register: result
  ignore_errors: yes

- debug: msg='Netconf feature is not supported on this platform!'
  when: result.failed

- name: Setup - Remove Vlan
  nxos_config:
    lines:
      - no vlan 42
  ignore_errors: yes
  when: not result.failed

- block:
  - name: Run netconf tests
    include: netconf.yaml
    when: not result.failed

  always:
  - name: Disable feature netconf
    nxos_feature:
      feature: netconf
      state: disabled
    vars: *ssh_credentials
    when: not result.failed

  - name: Cleanup - Remove vlan
    nxos_config:
      lines:
        - no vlan 42
    vars: *ssh_credentials
    ignore_errors: yes
    when: not result.failed