Skip to content

Use non-Ansible config deployment in 'netlab config' - #3947

Merged
ipspace merged 3 commits into
devfrom
nl-config-netmiko
Oct 14, 2026
Merged

ipspace merged 3 commits into
devfrom
nl-config-netmiko

Conversation

@ipspace

@ipspace ipspace commented Oct 14, 2026

Copy link
Copy Markdown
Owner

The 'netlab config' command used Ansible playbook to deploy custom config templates regardless of the device 'netlab_config_mode'.

This commit honors the 'netlab_config_mode' settings (where possible) in the 'netlab config' deployment:

  • The set_custom_config function has been augmented to recreate the data structures needed for non-ansible deployments
  • The Ansible config deployment was moved into a separate function (config_ansible_playbook)
  • The 'deploy_custom_config' code mirrors the 'netlab initial' deploy code. Internal methods are tried first, and if there are any nodes left, the Ansible playbook is called.

Caveat: This approach cannot be used for containers with 'sh' config mode, as we cannot (easily) map new files into containers.

The 'netlab config' command used Ansible playbook to deploy custom
config templates regardless of the device 'netlab_config_mode'.

This commit honors the 'netlab_config_mode' settings (where possible)
in the 'netlab config' deployment:

* The set_custom_config function has been augmented to recreate the
  data structures needed for non-ansible deployments
* The Ansible config deployment was moved into a separate function
  (config_ansible_playbook)
* The 'deploy_custom_config' code mirrors the 'netlab initial' deploy
  code. Internal methods are tried first, and if there are any
  nodes left, the Ansible playbook is called.

Caveat: This approach cannot be used for containers with 'sh' config
mode, as we cannot (easily) map new files into containers.

This comment was marked as resolved.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Combining --reload with --check can apply live configuration instead of previewing changes.

1 open finding
4 resolved since last review

🧠 Review effort: Balanced

Comment thread netsim/cli/config.py
@ipspace
ipspace merged commit e6f8903 into dev Oct 14, 2026
9 checks passed
@ipspace
ipspace deleted the nl-config-netmiko branch October 14, 2026 15:58
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.

2 participants