2016-10-28 18:50:29 +00:00
|
|
|
---
|
|
|
|
- debug: msg="START cli/config.yaml"
|
|
|
|
|
|
|
|
- name: setup
|
|
|
|
eos_config:
|
2017-01-09 17:21:04 +00:00
|
|
|
lines: hostname {{ inventory_hostname_short }}
|
2016-10-28 18:50:29 +00: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 08:38:25 +00:00
|
|
|
- name: get current running-config
|
|
|
|
eos_command:
|
|
|
|
commands: show running-config
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
register: config
|
|
|
|
|
2016-10-28 18:50:29 +00: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 17:21:04 +00:00
|
|
|
lines: hostname {{ inventory_hostname_short }}
|
2016-10-28 18:50:29 +00:00
|
|
|
match: none
|
|
|
|
provider: "{{ cli }}"
|
|
|
|
|
|
|
|
- debug: msg="END cli/config.yaml"
|