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

special on destroy operations #322

Open
verhulstm opened this issue Mar 23, 2018 · 1 comment
Open

special on destroy operations #322

verhulstm opened this issue Mar 23, 2018 · 1 comment

Comments

@verhulstm
Copy link
Member

verhulstm commented Mar 23, 2018

when we run "rambo destroy" I want rambo to ssh into the guest and runs a special "ondestroy" saltstate.

this salt state will usually just be a std simple saltstate pass function, but sometime the "ondestroy" state does other interesting things.

@nixjdm
Copy link
Member

nixjdm commented Mar 23, 2018

How would we do this? There are options.

My best idea so far, is to accept args on destroy that are the name of salt states to run, and then in the destroy-triggers block in the Vagrantfile, loop through those names, calling them specifically. Can you use salt-call to call a state not listed in the topfile / commented out? I'd assume these states should not be run on up / highstate. I'm not sure how to get them to only run on destroy easily.

The user could jerry-rig it by changing the states after up with another sync operation, but that's cumbersome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants