2016-10-28 20:50:29 +02:00
|
|
|
---
|
|
|
|
- debug: msg="START cli/config.yaml"
|
|
|
|
|
|
|
|
- name: setup
|
|
|
|
eos_config:
|
2017-01-09 18:21:04 +01:00
|
|
|
lines: hostname {{ inventory_hostname_short }}
|
2016-10-28 20:50:29 +02:00
|
|
|
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"
|
|
|
|
|
2017-07-12 10:38:25 +02:00
|
|
|
- name: get current running-config
|
|
|
|
eos_command:
|
|
|
|
commands: show running-config
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
register: config
|
|
|
|
|
2016-10-28 20:50:29 +02:00
|
|
|
- name: configure hostname again
|
|
|
|
eos_config:
|
|
|
|
lines: hostname foo
|
|
|
|
config: "{{ config.stdout[0] }}"
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
eos_config:
|
2017-01-09 18:21:04 +01:00
|
|
|
lines: hostname {{ inventory_hostname_short }}
|
2016-10-28 20:50:29 +02:00
|
|
|
match: none
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
|
|
|
|
- debug: msg="END cli/config.yaml"
|