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