Skip to content

Adding the ability to hash config during config replace - #1125

Open
joewesch wants to merge 8 commits into
developfrom
u/joewesch-config-replace-hash
Open

Adding the ability to hash config during config replace#1125
joewesch wants to merge 8 commits into
developfrom
u/joewesch-config-replace-hash

Conversation

@joewesch

@joewesch joewesch commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Closes: #494

This PR is the final portion of a larger plan to incorporate hashing as an alternative to string replacements in Golden Config.

Full Plan

Step 1 - Plumbing (DONE)

We introduce a jinja-aware config sanitizer function to netutils. This new function looks for jinja templating in the replacement filter and crafts a callable that can be used to capture the group from the input text and pass it through the Jinja renderer, enabling the use of all existing filters (hash_data for this use case).

Step 2 - Activation (DONE)

We update nornir-nautobot to use it in the same way we use sanitize_config:

        if any("{{" in item.get("replace", "") for item in substitute_lines):
            return sanitize_config_jinja(_running_config, substitute_lines)
        return sanitize_config(_running_config, substitute_lines)

We need to bump the minimum netutils version here to ensure it gets installed properly.

Step 2.5 - Bump nautobot-app-nornir (DONE)

Since nornir-nautobot is not a direct dependency of this repo, we need to bump it in nautobot-app-nornir and then bump that version here.

Step 3 - Documentation (this step)

With the change transparently activated in nornir-nautobot, we technically don't need to make any changes to this repo, but since this is the primary use case this PR contains detailed documentation and examples on how to use the new feature.

Once everything upstream has been released I will include a bump to the minimum version of nautobot-app-nornir here as well to ensure everything coalesces correctly.

@joewesch joewesch changed the title [WIP] Added documentation on using hashing during config replace [WIP] Adding the ability to hash config during config replace Jun 18, 2026
@github-actions

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

@joewesch
joewesch marked this pull request as ready for review August 18, 2026 13:40
@joewesch joewesch changed the title [WIP] Adding the ability to hash config during config replace Adding the ability to hash config during config replace Aug 18, 2026
@joewesch

Copy link
Copy Markdown
Contributor Author

The CI seems to be failing due to recent upstream changes: https://github.com/nautobot/nautobot-app-golden-config/actions/runs/31995237909

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.

Add hashing as an alternative to config replace

1 participant