Skip to content

Commit

Permalink
Update return param and example
Browse files Browse the repository at this point in the history
Signed-off-by: rohitthakur2590 <[email protected]>
  • Loading branch information
rohitthakur2590 committed Jan 8, 2024
1 parent 768032e commit 5ba12ba
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion changelogs/fragments/off_box_diff_enhancement.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
minor_changes:
- Implement off-box-diff optional feature.
- eos_config - Implement off-box-diff optional feature.
27 changes: 27 additions & 0 deletions docs/arista.eos.eos_config_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -497,6 +507,23 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;hostname switch01&#x27;, &#x27;interface Ethernet1&#x27;, &#x27;no shutdown&#x27;]</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
<b>context_diff</b>
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td></td>
<td>
<div>The diff between candidate and target config.</div>
<br/>
<div style="font-size: smaller"><b>Sample:</b></div>
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">&#x27; --- +++ @@ -1,7 +1,7 @@ ! Command: show running-config -! device: arista (vEOS, EOS-4.24.6M) +! device: candidate-arista-11 (vEOS, EOS-4.24.6M)&#x27;</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="return-"></div>
Expand Down
20 changes: 20 additions & 0 deletions plugins/modules/eos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,16 @@
backup_options:
filename: backup.cfg
dir_path: /home/user
- name:Get the full context diff
arista.eos.eos_config:

Check failure on line 287 in plugins/modules/eos_config.py

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[None]

Syntax error: mapping values are not allowed here (syntax)
src: candidate.cfg
backup: true
context_diff:
enable: true
backup_options:
filename: backup.cfg
dir_path: /home/user
"""

RETURN = """
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5ba12ba

Please sign in to comment.