2017-03-03 04:20:17 +01:00
|
|
|
---
|
|
|
|
- debug: msg="START eapi/set_hostname.yaml"
|
|
|
|
|
|
|
|
- name: setup
|
|
|
|
eos_config:
|
|
|
|
lines: hostname switch
|
|
|
|
match: none
|
2018-05-29 20:18:03 +02:00
|
|
|
become: yes
|
2017-03-03 04:20:17 +01:00
|
|
|
|
|
|
|
- name: configure hostname
|
|
|
|
eos_system:
|
|
|
|
hostname: foo
|
2018-05-29 20:18:03 +02:00
|
|
|
become: yes
|
2017-03-03 04:20:17 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: verify hostname
|
|
|
|
eos_system:
|
|
|
|
hostname: foo
|
2018-05-29 20:18:03 +02:00
|
|
|
become: yes
|
2017-03-03 04:20:17 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
eos_config:
|
|
|
|
lines: "hostname {{ inventory_hostname }}"
|
|
|
|
match: none
|
2018-05-29 20:18:03 +02:00
|
|
|
become: yes
|
2017-03-03 04:20:17 +01:00
|
|
|
|
|
|
|
- debug: msg="END eapi/set_hostname.yaml"
|