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

Support for ios_config + src + match: exact #655

Open
steffenschumacher opened this issue Sep 19, 2022 · 0 comments · May be fixed by #1050 or #778
Open

Support for ios_config + src + match: exact #655

steffenschumacher opened this issue Sep 19, 2022 · 0 comments · May be fixed by #1050 or #778
Labels
config ios_config module

Comments

@steffenschumacher
Copy link

steffenschumacher commented Sep 19, 2022

SUMMARY

In order to keep a series of eg. class-maps and policy-maps in sync with a template/config file, it would be awesome if ios_config would be able to accept src config file and match == exact, so that Ansible would automatically remove stuff from policies beyond just ensuring presence of the lines in the src config.
This would apply generically to all indented segments of the config, such as zone based firewall, interface templates etc etc.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

ios_config

ADDITIONAL INFORMATION

ios_config can ensure the lines from my template is present, but it could also ensure leftovers are removed within indented config blocks - it cannot (of course) remove entire config blocks which are removed from templates naturally.
The alternative to this, would be to do per-config-block tasks with individual parent/lines, and if I prefer to have eg. all my base QoS config bits in a single j2 template, then it gets hard to manage.
It would also allow me to reuse templates with eg. DNA Center, so they are in sync across all tools managing config

---

- name: QoS test play
  hosts: all
  vars:
    ansible_command_timeout: 60
    ansible_connection: 'network_cli'
    ansible_network_os: 'cisco.ios.ios'
  gather_facts: no
  tasks:
    - name: class- and policy-maps
      ios_config:
        backup: no
        src: policymap.cfg
        match: exact
class-map match-any MARK_BUSINESS_INTERNET
 match protocol ms-lync-video
 match protocol ms-lync
 match protocol ms-services
 match protocol ms-teams
 match protocol ms-teams-video
 match protocol ms-office-365
 match protocol ms-office-web-apps
class-map match-any MARK_EMAIL
 match protocol outlook-web-service
 match ip dscp ef
policy-map REMARK_INCOMING_LAN
 class MARK_BUSINESS_INTERNET
  set dscp af41
 class MARK_EMAIL
  set dscp af32
@KB-perByte KB-perByte added the config ios_config module label Feb 20, 2023
@bentole bentole linked a pull request Mar 14, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config ios_config module
Projects
None yet
2 participants