summaryrefslogtreecommitdiff
path: root/test/integration/targets/eos_config/tests/cli/config.yaml
blob: d95a491a4b21e803c6e4f498cfc620ca1c382dd2 (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 cli/config.yaml"

- name: setup
  eos_config:
    lines: hostname {{ inventory_hostname }}
    match: none
    provider: "{{ cli }}"

- name: get current running-config
  eos_command:
    commands: show running-config
    provider: "{{ cli }}"
  register: config

- name: configure hostname
  eos_config:
    lines: hostname foo
    config: "{{ config.stdout[0] }}"
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == true"
      - "'hostname foo' in result.updates"

- name: configure hostname again
  eos_config:
    lines: hostname foo
    config: "{{ config.stdout[0] }}"
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == false"
      - "'hostname foo' in result.updates"

- name: teardown
  eos_config:
    lines: hostname {{ inventory_hostname }}
    match: none
    provider: "{{ cli }}"

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