2018-06-14 14:32:19 +02:00
|
|
|
---
|
|
|
|
- debug: msg="START cli/diff.yaml on connection={{ ansible_connection }}"
|
|
|
|
|
2018-07-09 16:12:48 +02:00
|
|
|
- name: Ensure hostname is preset
|
|
|
|
ios_system:
|
|
|
|
hostname: "{{ shorter_hostname }}"
|
|
|
|
|
2018-06-14 14:32:19 +02:00
|
|
|
- name: ios_config diff against retrieved config
|
|
|
|
ios_config:
|
|
|
|
diff_against: intended
|
|
|
|
intended_config: "{{ lookup('file', '{{ role_path }}/templates/basic/intended_running_config') }}"
|
|
|
|
diff: true
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "'hostname an-ios-02.ansible.com' in result['diff']['after']"
|
|
|
|
- "'hostname {{ shorter_hostname }}' in result['diff']['before']"
|
|
|
|
|
|
|
|
- name: ios_config diff against provided running_config
|
|
|
|
ios_config:
|
|
|
|
diff_against: intended
|
|
|
|
intended_config: "{{ lookup('file', '{{ role_path }}/templates/basic/intended_running_config') }}"
|
|
|
|
running_config: "{{ lookup('file', '{{ role_path }}/templates/basic/base_running_config') }}"
|
|
|
|
diff: true
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "'hostname an-ios-02.ansible.com' in result['diff']['after']"
|
|
|
|
- "'hostname an-ios-01.ansible.com' in result['diff']['before']"
|
|
|
|
|
|
|
|
- debug: msg="END cli/diff.yaml on connection={{ ansible_connection }}"
|