2016-10-28 20:50:29 +02:00
|
|
|
---
|
2017-12-19 21:49:49 +01:00
|
|
|
- debug: msg="START cli/config.yaml on connection={{ ansible_connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- 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 }}"
|
2017-12-19 21:49:49 +01:00
|
|
|
become: yes
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: get current running-config
|
|
|
|
eos_command:
|
|
|
|
commands: show running-config
|
|
|
|
provider: "{{ cli }}"
|
2017-12-19 21:49:49 +01:00
|
|
|
become: yes
|
2016-10-28 20:50:29 +02:00
|
|
|
register: config
|
|
|
|
|
|
|
|
- name: configure hostname
|
|
|
|
eos_config:
|
|
|
|
lines: hostname foo
|
|
|
|
config: "{{ config.stdout[0] }}"
|
|
|
|
provider: "{{ cli }}"
|
2017-12-19 21:49:49 +01:00
|
|
|
become: yes
|
2016-10-28 20:50:29 +02:00
|
|
|
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 }}"
|
2017-12-19 21:49:49 +01:00
|
|
|
become: yes
|
2017-07-12 10:38:25 +02:00
|
|
|
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 }}"
|
2017-12-19 21:49:49 +01:00
|
|
|
become: yes
|
2016-10-28 20:50:29 +02:00
|
|
|
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 }}"
|
2017-12-19 21:49:49 +01:00
|
|
|
become: yes
|
2016-10-28 20:50:29 +02:00
|
|
|
|
2017-12-19 21:49:49 +01:00
|
|
|
- debug: msg="END cli/config.yaml on connection={{ ansible_connection }}"
|