nautobot-app-ssot icon indicating copy to clipboard operation
nautobot-app-ssot copied to clipboard

Allow for a diff created by a dry run to be later re-used without re-calculating it

Open Kircheneer opened this issue 1 year ago • 4 comments

Environment

  • Nautobot version: latest
  • nautobot-ssot version: latest

Proposed Functionality

Using the dry-run functionality, we can generate a diff. It would be nice if we could then later apply that diff without recalculating it.

Use Case

This would allow for more sophisticated and deterministic approval processes, i.e. having a process like:

  • generate diff with dry run
  • validate diff manually and approve it for deployment
  • deploy diff (and only that diff, not any changes that happened in the meantime)

Caveats

I believe care needs to be taken at what happens if the target systems state changes in the meantime. If it does, the diff might be corrupt?

Kircheneer avatar May 31 '23 07:05 Kircheneer

I think that you will always need to get the actual state... what you could use it for is if there is an approval state, using a previous diff, you skip it (similar to what Terraform does with inputting a previous plan in the apply stage)

chadell avatar Jun 08 '23 07:06 chadell

Yeah terraform with the plan feature is something that mirrors this very well

Kircheneer avatar Jun 08 '23 08:06 Kircheneer

This would also open the door to distributed processing of the diff.

lampwins avatar Jun 23 '23 20:06 lampwins

This may be particularly interesting for 'outgoing' jobs, i.e. ones where we mutate the state of an external system (think a network device controller) using data from Nautobot.

Kircheneer avatar Oct 05 '23 13:10 Kircheneer