2017-03-03 03:20:17 +00:00
|
|
|
---
|
|
|
|
- debug: msg="START eapi/set_hostname.yaml"
|
|
|
|
|
|
|
|
- name: setup
|
|
|
|
eos_config:
|
|
|
|
lines: hostname switch
|
|
|
|
match: none
|
2017-07-14 15:10:53 +00:00
|
|
|
timeout: 30
|
2017-03-03 03:20:17 +00:00
|
|
|
provider: "{{ eapi }}"
|
|
|
|
|
|
|
|
- name: configure hostname
|
|
|
|
eos_system:
|
|
|
|
hostname: foo
|
2017-07-14 15:10:53 +00:00
|
|
|
timeout: 30
|
2017-03-03 03:20:17 +00:00
|
|
|
provider: "{{ eapi }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: verify hostname
|
|
|
|
eos_system:
|
|
|
|
hostname: foo
|
2017-07-14 15:10:53 +00:00
|
|
|
timeout: 30
|
2017-03-03 03:20:17 +00:00
|
|
|
provider: "{{ eapi }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
eos_config:
|
|
|
|
lines: "hostname {{ inventory_hostname }}"
|
|
|
|
match: none
|
2017-07-14 15:10:53 +00:00
|
|
|
timeout: 30
|
2017-03-03 03:20:17 +00:00
|
|
|
provider: "{{ eapi }}"
|
|
|
|
|
|
|
|
- debug: msg="END eapi/set_hostname.yaml"
|