ansible-junos-stdlib: Enhancement: commit configuration despite warnings "statement not found" are raised
ansible does not provide an efficient way to do selective committing of changes depending on the configuration available in the device. To address this issue and provided Juniper’s configuration database architecture one may decide to delete a whole section of configuration and send it again to ensure consistency with the local repository.
For instance,
delete snmp
set snmp name example.com
...
Another example tackles the creation of a prefix list where order of statements is important and a new entry should be places somewhere but the end of a list.
If the aforementioned approach is adopted (firstly to delete sections and then build them again), there might be cases where warnings “statement not found” may be raised (ie during the initial provisioning when the respective configuration snippet is missing).
This enhancement proposes the implementation of a mechanism in the junos_install_config where users may decide to ignore such warnings and proceed with committing their configuration.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 17 (14 by maintainers)
@Milan-Benes Sure.
Let’s say that a router may or may not have a firewall filter defined. To avoid the “statement not found” error, define the filter in the most minimalist way before deleting it.
This is useful when working on networks that are not built from templates. These networks tend to be full of cruft and other forms of configuration drift. Getting such networks to a point that they can be templatized is very manual and tedious. This hack only fixes a subset of the problems though. We’ll be in a better position once a real fix is delivered.