Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salt minion provisioning: cleanup after provisioned #5242

Closed
davidkarlsen opened this issue Jan 24, 2015 · 9 comments
Closed

Salt minion provisioning: cleanup after provisioned #5242

davidkarlsen opened this issue Jan 24, 2015 · 9 comments

Comments

@davidkarlsen
Copy link

It would be nice to call saltutil.clear_cache after finishing provisioning - this would clear out the salt minion cache in /var/cache/salt/minion .

Now I have to add this in my Vagrantfile:
config.vm.provision :shell, :inline => "salt-call saltutil.clear_cache"

@obestwalter
Copy link

Forcibly removes all caches on a minion.
New in version 2014.7.0.
WARNING: The safest way to clear a minion cache is by first stopping the minion and then deleting the cache files before restarting it.

link

@davidkarlsen I am not quite sure, why I would want this by default. I am not using it in my setups and it doesn't sound like something that should be always done. Could you explain, why you think this is necessary as a default?

@davidkarlsen
Copy link
Author

Because I use salt masterless to build a box and repackage it for distribution. And I want to remove as much residual config as possible (caches in var etc), before I zero and repackage the image.

@obestwalter
Copy link

I understand. So this should be introduced as a configurable option that is deactivated by default. Do you agree?

@davidkarlsen
Copy link
Author

That sounds reasonable

@obestwalter
Copy link

Well, I am a reasonable man. I will try to get another change in that touches the part of the code that will be involved in this change here (at least I think so - I did not dive into the sources yet). So if I get #5849 done I might be able to add this as well.

I wonder if we should do this a bit more generic right away to make it possible to issue an arbitrary call (or script) after provisioning to make this usable for other scenarios as well. I don't know if something like this would be useful though ...

@mitchellh Is there any kind of generic post provisioning step/hook that could be used for use cases like this?

@obestwalter
Copy link

On the other hand: the way you're doing it at the moment is somehow a post provisioning step by using the shell provisioner - so this is actually doing the job just fine. Maybe this enhancement is not really necessary for something specialized like you are doing?

@obestwalter
Copy link

@davidkarlsen What did you think about my last suggestion? I think we could close this as wontfix - do you agree?

@chrisroberts
Copy link
Member

Related: #3849

@chrisroberts chrisroberts added this to the 2.0 milestone Sep 30, 2016
@chrisroberts chrisroberts modified the milestones: 1.10, 1.9.0 Oct 26, 2016
@chrisroberts chrisroberts modified the milestones: Secondary, 1.9.0 Nov 8, 2016
@chrisroberts
Copy link
Member

Hi there,

We would really like this, but this issue has been open for over a year with no one working on it, Leaving it open is unfortunately making our issue count look higher than it is. I’m going to close this and if someone wants to work on it I’d still be open to a PR!

Cheers!

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants