Skip to content

Cleanup VyOS templates#3054

Open
ipspace wants to merge 1 commit intodevfrom
vyos-cfg
Open

Cleanup VyOS templates#3054
ipspace wants to merge 1 commit intodevfrom
vyos-cfg

Conversation

@ipspace
Copy link
Owner

@ipspace ipspace commented Feb 1, 2026

Removes the common vbash-specific bits from VyOS templates, as those bits are handled by the deployment task list.

Removes the common vbash-specific bits from VyOS templates, as those
bits are handled by the deployment task list.
@ipspace
Copy link
Owner Author

ipspace commented Feb 1, 2026

@ssasso -- Finally found time to clean the VyOS templates

ipspace added a commit that referenced this pull request Feb 1, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes embedded vbash/script scaffolding from VyOS Jinja templates so config scripts can be wrapped/executed consistently by the deploy-config task logic.

Changes:

  • Strips common VyOS vbash boilerplate (#!/bin/vbash, configure, commit/save/exit scaffolding) from multiple VyOS templates.
  • Updates BGP session/policy templates’ inline section headers and keeps post-config BGP refresh actions where present.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
netsim/extra/firewall.zonebased/vyos.j2 Removes vbash wrapper and commit/save/exit footer so deploy wrapper owns session lifecycle.
netsim/extra/bgp.session/vyos.j2 Removes vbash wrapper and restructures headers; retains commit/save + BGP clears.
netsim/extra/bgp.policy/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
netsim/ansible/templates/vxlan/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
netsim/ansible/templates/vrf/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
netsim/ansible/templates/vlan/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
netsim/ansible/templates/routing/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
netsim/ansible/templates/ripv2/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
netsim/ansible/templates/ospf/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
netsim/ansible/templates/mpls/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
netsim/ansible/templates/lag/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
netsim/ansible/templates/initial/vyos.j2 Removes vbash wrapper and save/exit boilerplate, leaving commit + post-steps.
netsim/ansible/templates/gateway/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
netsim/ansible/templates/evpn/vyos.j2 Removes vbash wrapper; adjusts neighbor stanza and keeps commit/save + BGP clear.
netsim/ansible/templates/bfd/vyos.j2 Removes vbash wrapper and commit/save/exit footer.
Comments suppressed due to low confidence (1)

netsim/extra/bgp.session/vyos.j2:82

  • vyos-script.j2 always appends commit/save/exit around script_content; keeping commit/save in this template will now execute them twice and also makes the vtysh clears run before the wrapper’s final exit (holding the config session open longer). Consider moving the vtysh clears into an Ansible post-task (or enhancing the wrapper with a post-commit hook) so this template can be pure set commands again.
commit
save

vtysh -c 'clear bgp *'
{% if vrfs is defined %}
{%   for vname,vdata in vrfs.items() if vdata.bgp is defined and vdata.bgp.neighbors is defined %}
vtysh -c 'clear bgp vrf {{ vname }} *'

@ipspace
Copy link
Owner Author

ipspace commented Feb 1, 2026

Note to self: Document exceptions pointed out by Copilot in the final commit message.

ipspace added a commit that referenced this pull request Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant