Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for src plus match:exact (revive abandoned pull request) #1050

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

amalmborg97
Copy link

SUMMARY

This is a restoration of PR #778 initially submitted by @bentole. This feature would be fantastic and I would love to see it to the finish line. The only modification I have made is providing a changelog fragment.

Below is his initial PR description.


Fixes #655
Fixes #740
Fixes #771
Fixes #129 (related)

Add support for device configuration to exactly match the provided template configuration guaranteeing consistency and idempotency.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

cisco.ios.ios_config

ADDITIONAL INFORMATION

Feature best described by using an example:

play

- name: Make sure running-config exactly matches the template
  cisco.ios.ios_config:
    match: exact
    src: template.j2

template.j2

class-map match-all FOO
 description I am FOO
 match dscp af41
class-map match-all BAR
 description I am BAR
 match dscp af31

running-config before

class-map match-all FOO
 match dscp af42
 match dscp af43

commands fired

class-map match-all FOO
 no match dscp af42
 no match dscp af43
 description I am FOO
 match dscp af41
class-map match-all BAR
 description I am BAR
 match dscp af31

running-config after

class-map match-all FOO
 description I am FOO
 match dscp af41 
class-map match-all BAR
 description I am BAR
 match dscp af31 

Consecutive Runs:
changed: false aka Idempotent!

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.80%. Comparing base (c9841b5) to head (3e60598).
Report is 14 commits behind head on main.

Current head 3e60598 differs from pull request most recent head cac56a2

Please upload reports for the commit cac56a2 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1050      +/-   ##
==========================================
- Coverage   86.90%   86.80%   -0.10%     
==========================================
  Files         193      199       +6     
  Lines       11904    12077     +173     
==========================================
+ Hits        10345    10484     +139     
- Misses       1559     1593      +34     

see 70 files with indirect coverage changes

Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/2b0d1f5bcf36452fb5cd07c9407c5dee

✔️ ansible-galaxy-importer SUCCESS in 5m 06s
✔️ build-ansible-collection SUCCESS in 13m 11s
ansible-ee-integration-ios-latest RETRY_LIMIT in 3m 21s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 14m 52s (non-voting)
ansible-ee-integration-ios-stable-2.11 RETRY_LIMIT in 3m 11s (non-voting)
ansible-ee-integration-ios-stable-2.12 RETRY_LIMIT in 3m 32s (non-voting)
ansible-ee-integration-ios-libssh-latest RETRY_LIMIT in 3m 02s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 37m 08s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 RETRY_LIMIT in 3m 30s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 RETRY_LIMIT in 3m 09s (non-voting)
ansible-tox-linters FAILURE in 15m 10s

@KB-perByte KB-perByte self-requested a review April 3, 2024 09:03
Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/d026455b533740d7847bc1fca3f7a3c4

⚠️ ansible-galaxy-importer SKIPPED Skipped due to failed job build-ansible-collection
build-ansible-collection RETRY_LIMIT in 8m 08s
⚠️ ansible-ee-integration-ios-latest SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-stable-2.9 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-stable-2.11 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-stable-2.12 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-libssh-latest SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-libssh-stable-2.9 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-libssh-stable-2.11 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-libssh-stable-2.12 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
ansible-tox-linters RETRY_LIMIT in 8m 39s

@amalmborg97
Copy link
Author

recheck

Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/f52b5d729f7a4eaab55ccb66a6bf012d

⚠️ ansible-galaxy-importer SKIPPED Skipped due to failed job build-ansible-collection
build-ansible-collection RETRY_LIMIT in 4m 10s
⚠️ ansible-ee-integration-ios-latest SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-stable-2.9 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-stable-2.11 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-stable-2.12 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-libssh-latest SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-libssh-stable-2.9 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-libssh-stable-2.11 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-ee-integration-ios-libssh-stable-2.12 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
ansible-tox-linters RETRY_LIMIT in 9m 40s

@amalmborg97
Copy link
Author

I'm sorry for the tag, I need a maintainer to approve the workflow. Is there anything you need from me before the workflow is approved?

Thanks!

@KB-perByte

@KB-perByte KB-perByte requested review from roverflow and removed request for KB-perByte May 31, 2024 13:30
@KB-perByte
Copy link
Collaborator

CC @roverflow

@roverflow
Copy link
Member

Hey @amalmborg97, could you please add some tests for the above change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants