-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Background:
Today, the behavior seen when the Chef VM extension is uninstalled is that the configuration folder (e.g. c:\chef) remains on the VM, and the node/client keys remain on the Chef Server too.
I believe this was done originally (when the installer was bundled inside the extension) to support upgrade scenarios where we need to leave the client intact between upgrades. We then moved to a model where the installer payload did not form part of the extension bue is delivered through omnitruck.chef.io. We then never circled back to fully support a complete uninstall (including configuration). For scenarios where an external orchestrator controls the extension lifecycle, it would be useful to be able to cleanup this data.
Proposal:
Allow the extension to optionally remove the local configuration and the node/client data stored on the server as well as any local configuration on the VM.
Acceptance Criteria:
- A new ARM property for the extension should be recognized by the extension (example/suggestion for name:
destroy_client_configuration_on_uninstall- default:falseto preserve existing behavior) - The property is then read at uninstallation time:
- If the property is set to
false(the default) then the existing logic is used, and the node/client is not removed from the Chef Server, and all local configuration is not deleted when the Extension is uninstalled. - If the property is set to
truethen the Chef client.pem should be used to make a call to the Chef Server API to delete the client and node data, and then the Chef configuration folder (e.g. c:\chef) should be deleted in its entirety.
- If the property is set to
It is likely that extending the existing Ruby inside the extension would be the best place to implement this as it has access to the various Chef client helpers that perform most of the legwork. But this is not set in stone and is an implementation detail.