2017-03-03 04:20:17 +01:00
|
|
|
---
|
2017-12-19 21:49:49 +01:00
|
|
|
- debug: msg="START cli/set_hostname.yaml on connection={{ ansible_connection }}"
|
2017-03-03 04:20:17 +01:00
|
|
|
|
|
|
|
- name: setup
|
|
|
|
eos_config:
|
|
|
|
lines: hostname switch
|
|
|
|
match: none
|
2017-12-19 21:49:49 +01:00
|
|
|
become: yes
|
2017-03-03 04:20:17 +01:00
|
|
|
|
|
|
|
- name: configure hostname
|
|
|
|
eos_system:
|
|
|
|
hostname: foo
|
2017-12-19 21:49:49 +01: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
|
2017-12-19 21:49:49 +01: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
|
2017-12-19 21:49:49 +01:00
|
|
|
become: yes
|
2017-03-03 04:20:17 +01:00
|
|
|
|
2017-12-19 21:49:49 +01:00
|
|
|
- debug: msg="END cli/set_hostname.yaml on connection={{ ansible_connection }}"
|