2018-01-17 15:29:28 +01:00
|
|
|
---
|
|
|
|
- debug:
|
|
|
|
msg: "START netconf/set_hostname.yaml on connection={{ ansible_connection }}"
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: setup
|
|
|
|
iosxr_config:
|
|
|
|
lines: hostname switch
|
|
|
|
match: none
|
|
|
|
provider: "{{ cli }}"
|
2018-01-24 15:16:27 +01:00
|
|
|
connection: network_cli
|
2018-01-17 15:29:28 +01:00
|
|
|
|
|
|
|
- name: configure hostname
|
|
|
|
iosxr_system:
|
|
|
|
hostname: foo
|
|
|
|
provider: "{{ netconf }}"
|
2018-01-24 15:16:27 +01:00
|
|
|
connection: netconf
|
2018-01-17 15:29:28 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: verify hostname
|
|
|
|
iosxr_system:
|
|
|
|
hostname: foo
|
|
|
|
provider: "{{ netconf }}"
|
2018-01-24 15:16:27 +01:00
|
|
|
connection: netconf
|
2018-01-17 15:29:28 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2018-08-10 21:55:25 +02:00
|
|
|
always:
|
2018-01-17 15:29:28 +01:00
|
|
|
- name: teardown
|
|
|
|
iosxr_config:
|
|
|
|
lines: "hostname {{ inventory_hostname }}"
|
|
|
|
match: none
|
|
|
|
provider: "{{ cli }}"
|
2018-01-24 15:16:27 +01:00
|
|
|
connection: network_cli
|
2018-01-17 15:29:28 +01:00
|
|
|
|
|
|
|
- debug:
|
|
|
|
msg: "END netconf/set_hostname.yaml on connection={{ ansible_connection }}"
|