ansible-collections / cisco.ios

Ansible Network Collection for Cisco IOS
GNU General Public License v3.0
261 stars 162 forks source link

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

Open amalmborg97 opened 1 month ago

amalmborg97 commented 1 month ago
SUMMARY

This is a restoration of PR https://github.com/ansible-collections/cisco.ios/pull/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 https://github.com/ansible-collections/cisco.ios/issues/655 Fixes https://github.com/ansible-collections/cisco.ios/issues/740 Fixes https://github.com/ansible-collections/cisco.ios/issues/771 Fixes https://github.com/ansible-collections/cisco.ios/issues/129 (related)

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

ISSUE TYPE
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!

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.64%. Comparing base (c9841b5) to head (b31e034).

:exclamation: Current head b31e034 differs from pull request most recent head 8d78023. Consider uploading reports for the commit 8d78023 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1050 +/- ## ========================================== - Coverage 86.90% 86.64% -0.26% ========================================== Files 193 193 Lines 11904 11938 +34 ========================================== - Hits 10345 10344 -1 - Misses 1559 1594 +35 ``` [see 2 files with indirect coverage changes](https://app.codecov.io/gh/ansible-collections/cisco.ios/pull/1050/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections)
softwarefactory-project-zuul[bot] commented 1 month ago

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

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

softwarefactory-project-zuul[bot] commented 1 month ago

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

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

amalmborg97 commented 1 month ago

recheck

softwarefactory-project-zuul[bot] commented 1 month ago

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

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

amalmborg97 commented 1 month ago

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