-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relax restrictions on replace option with block and src (#945)
* Relax restrictions on replace option with block and src * fix tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Ashwini Mhatre <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
bbfdcbd
commit a2a0dc4
Showing
5 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
minor_changes: | ||
- "ios_config - Relax restrictions on I(src) parameter so it can be used more like I(lines)." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
tests/integration/targets/ios_config/templates/basic/acl_config.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ip access-list extended test | ||
permit ip host 192.0.2.1 any log | ||
permit ip host 192.0.2.2 any log | ||
permit ip host 192.0.2.3 any log |
28 changes: 28 additions & 0 deletions
28
tests/integration/targets/ios_config/tests/cli/replace_config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
- ansible.builtin.debug: msg="START cli/replace_block.yaml on connection={{ ansible_connection }}" | ||
|
||
- name: "setup" | ||
cisco.nxos.nxos_config: | ||
lines: | ||
- "no ip access-list extended test" | ||
|
||
- name: "Populate nxos acls configuration with replace block and lines options" | ||
register: result1 | ||
cisco.ios.ios_config: | ||
lines: "{{ lookup('template', 'basic/acl_config.j2') }}" | ||
replace: block | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- result1.changed == true | ||
|
||
- name: "Populate acl configuration with replace block and src options" | ||
register: result2 | ||
cisco.ios.ios_config: | ||
src: basic/acl_config.j2 | ||
replace: block | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- result2.changed == true | ||
- result1.commands == result2.commands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters