Numerous network automation deployments happen in brownfield installations: you’re trying to automate parts of existing network deployment and operations processes. If you’re lucky you start automating deployment of new devices… but what if you have to automate parts of existing device configurations?
If someone considered network automation requirements when buying the gear for your network you have an easy job. When using devices that support atomic configuration commits (example: Junos, IOS XR, Arista EOS) it’s easy to remove whole configuration sections (for example: no router bgp 1234) and replace them with automatically-built equivalents. Guess what happens when you try to pull off the same trick on almost any other network device ;)
Josef Fuchs decided to solve this problem when creating a network automation solution while attending the Building Network Automation Solutions online course: he wrote an Ansible playbook (and later a Python Jinja2 filter) that merges existing device configuration with template-generated parts and deploys the new configuration with NAPALM configuration replace functionality.
Thanks to Ivan Pepelnjak (see source)