purpleidea / mgmt

Next generation distributed, event-driven, parallel config management!
https://purpleidea.com/tags/mgmtconfig/
GNU General Public License v3.0
3.63k stars 313 forks source link

Deploys should allow removal or reuse of existing reversible resource tokens #539

Open purpleidea opened 5 years ago

purpleidea commented 5 years ago

When reversible resources are enabled, they leave a token in a state file somewhere to specify to the subsequent graph (in the stream of resource graphs) that this resource needs to be added in.

Occasionally, the user might push a new version of the mcl code which could conceivably be either a logical continuation of the previous code, and where we'd like to preserve the tokens OR it could be a logical break where we don't want to have anything to do with the previous code, and any possible reversed resources.

As a result, we should have a flag in deploy to specify which scenario we'd prefer for that new deploy. If we wanted to get fancy, we might even be able to specify that we want to remove some of the tokens but not all.

For the implementation, we'd probably want to store the deploy_id in the token for each reversed resource so that we'd know whether a new deploy is newer or not. This is because some tokens might exist in etcd and it would be good to know whether we're newer or not.

Happy Hacking!

purpleidea commented 5 years ago

Extra note: We might even consider that a reverse_preserve metaparam (or similarly named) per resource would specify if by default it should survive new code deploys or not. Of course it should also get overridden by whatever flag you specify on deploy.