Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a Nornir task plugin for utilizing Capirca to generate per-host ACLs. Upon success, the rendered ACL is returned as a string in the result field of a
Result
. For an ACL to be rendered, the plugin must be passed a valid capirca platform type and the host platform must be a target in the specified policy file:This platform value is different than the top-level platform inventory field, as the existing inventory values (i.e. junos) didn't map 1:1 to capirca platforms, and maintaining a translation map seemed implicitly terrible. Therefore, the capirca platform type must be explicitly passed but can be included as inventory data as below and passed at task runtime:
The application dependency of Capirca v1.122/latest was left off this PR per the contributing guidelines. Please let me know if you want it added here, in a separate PR or if you will handle it.
Also, if there is value, I'm happy to add this as a Nornir function as well, which would most likely render and write ACLs to a specified directory, much like the current Capirca toolchain.