diff --git a/changelogs/fragments/off_box_diff_enhancement.yaml b/changelogs/fragments/off_box_diff_enhancement.yaml index 9a5c74391..e42f846aa 100644 --- a/changelogs/fragments/off_box_diff_enhancement.yaml +++ b/changelogs/fragments/off_box_diff_enhancement.yaml @@ -1,3 +1,3 @@ --- minor_changes: - - Implement off-box-diff optional feature. + - eos_config - Implement off-box-diff optional feature. diff --git a/docs/arista.eos.eos_config_module.rst b/docs/arista.eos.eos_config_module.rst index 37b9891be..24bf4ceb1 100644 --- a/docs/arista.eos.eos_config_module.rst +++ b/docs/arista.eos.eos_config_module.rst @@ -449,6 +449,16 @@ Examples filename: backup.cfg dir_path: /home/user + - name:Get the full context diff + arista.eos.eos_config: + src: candidate.cfg + backup: true + context_diff: + enable: true + backup_options: + filename: backup.cfg + dir_path: /home/user + Return Values @@ -497,6 +507,23 @@ Common return values are documented `here ['hostname switch01', 'interface Ethernet1', 'no shutdown'] + + +
+ context_diff + +
+ string +
+ + + +
The diff between candidate and target config.
+
+
Sample:
+
' --- +++ @@ -1,7 +1,7 @@ ! Command: show running-config -! device: arista (vEOS, EOS-4.24.6M) +! device: candidate-arista-11 (vEOS, EOS-4.24.6M)'
+ +
diff --git a/plugins/modules/eos_config.py b/plugins/modules/eos_config.py index cc043cc6e..cc19f8e22 100644 --- a/plugins/modules/eos_config.py +++ b/plugins/modules/eos_config.py @@ -282,6 +282,16 @@ backup_options: filename: backup.cfg dir_path: /home/user + +- name:Get the full context diff + arista.eos.eos_config: + src: candidate.cfg + backup: true + context_diff: + enable: true + backup_options: + filename: backup.cfg + dir_path: /home/user """ RETURN = """ @@ -320,6 +330,16 @@ returned: when backup is true type: str sample: "22:28:34" +context_diff: + description: The diff between candidate and target config. + type: str + sample: ''' + --- + +++ + @@ -1,7 +1,7 @@ + ! Command: show running-config + -! device: arista (vEOS, EOS-4.24.6M) + +! device: candidate-arista-11 (vEOS, EOS-4.24.6M)''' """ from ansible.module_utils._text import to_text from ansible.module_utils.basic import AnsibleModule