summaryrefslogtreecommitdiff
path: root/test/integration/targets/nxos_nxapi/tests/cli/config.yaml
blob: 6dd9f9d1caf3c76e64eff428668a53c3aef91e80 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
- debug: msg="START cli/config.yaml"


#----
- name: Setup
  nxos_config:
    lines: no feature nxapi
    match: none
    provider: "{{ cli }}"
  connection: local

- name: Get running-config
  nxos_command:
    commands: show running-config
    provider: "{{ cli }}"
  register: config
  connection: local

- name: Set config
  nxos_nxapi:
    config: "{{ config.stdout[0] }}"
    provider: "{{ cli }}"
  register: config
  connection: local

# Triggers the following changes:
#    "updates": [
#        "feature nxapi",
#        "nxapi http port 80",
#        "no nxapi https",
#        "no nxapi sandbox"
#    ],

- name: Ensure that this triggered a change
  assert:
    that:
      - "config.changed == true"

#---
- name: Get running-config again
  nxos_command:
    commands: show running-config
    provider: "{{ cli }}"
  register: runningconfig
  connection: local

- name: Set config
  nxos_nxapi:
    config: "{{ runningconfig.stdout[0] }}"
    provider: "{{ cli }}"
  register: config
  connection: local

# BUG: The above shouldn't trigger the following updates
# Triggers the following changes:
#    "updates": [
#        "nxapi http port 80",
#        "no nxapi https",
#        "no nxapi sandbox"
#    ],



# DEBUG: Try another time
- name: Set config - FIXME, shouldn't need this
  nxos_nxapi:
    config: "{{ runningconfig.stdout[0] }}"
    provider: "{{ cli }}"
  register: config
  connection: local

# BUG: We are still getting changes
# Triggers the following changes:
#    "updates": [
#        "nxapi http port 80",
#        "no nxapi https",
#        "no nxapi sandbox"
#    ],

- name: Idempotency check
  assert:
    that:
      - "config.changed == false"
# FIXME: https://github.com/ansible/ansible-modules-core/issues/4955
  ignore_erros: yes

- debug: msg="END cli/config.yaml"