mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
don't retrieve config in running_config when config is provided for diff (#41400)
* don't retrieve config in running_config when config is provided for diff Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix for eos, nxos Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * add integration test Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
a4f49ed648
commit
8ab0d654f3
9 changed files with 106 additions and 6 deletions
|
@ -0,0 +1,9 @@
|
|||
version 15.6
|
||||
service timestamps debug datetime msec
|
||||
service timestamps log datetime msec
|
||||
no service password-encryption
|
||||
!
|
||||
hostname an-ios-01.ansible.com
|
||||
!
|
||||
boot-start-marker
|
||||
boot-end-marker
|
|
@ -0,0 +1,9 @@
|
|||
version 15.6
|
||||
service timestamps debug datetime msec
|
||||
service timestamps log datetime msec
|
||||
no service password-encryption
|
||||
!
|
||||
hostname an-ios-02.ansible.com
|
||||
!
|
||||
boot-start-marker
|
||||
boot-end-marker
|
29
test/integration/targets/ios_config/tests/cli/diff.yaml
Normal file
29
test/integration/targets/ios_config/tests/cli/diff.yaml
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
- debug: msg="START cli/diff.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
- 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 }}"
|
Loading…
Add table
Add a link
Reference in a new issue