-
Notifications
You must be signed in to change notification settings - Fork 665
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
Add 'halt' option to vagrant module #1233
Conversation
Doesn't this functionality already exist? |
hey @retr0h !! technically the section you highlighted already performs a halt but then immediately afterwards it performs a destroy if self._module.params['force_stop']:
self._vagrant.halt(force=True)
self._vagrant.destroy() I just want the halt functionality without destroying the machine. Hope that makes more sense. |
See PR ansible/molecule#1233. Before we package up the vagrant machine into a box, we need to shutdown the vagrant box. The built-in molecule module only had `up` or `destroy`. *fingers-crossed* this gets in upstream and we can tear this out.
@msheiny oh yeah, I see. Can you update the module docs and add an example. |
def halt(self): | ||
changed = False | ||
cd = self._created() | ||
if cd: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not "if self._created()"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a good observation @berendt ... I'd like to keep my PR pretty lean though and since that paradigm is already used throughout the file. I think filing a different PR to cleanup that specific logic would be a better course of action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msheiny Have not checked the rest of the file. if it is used everywhere else it fits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See PR ansible/molecule#1233. Before we package up the vagrant machine into a box, we need to shutdown the vagrant box. The built-in molecule module only had `up` or `destroy`. *fingers-crossed* this gets in upstream and we can tear this out.
updated @retr0h ! 👍 |
Thanks @msheiny ! |
See PR ansible/molecule#1233. Before we package up the vagrant machine into a box, we need to shutdown the vagrant box. The built-in molecule module only had `up` or `destroy`. *fingers-crossed* this gets in upstream and we can tear this out.
See PR ansible/molecule#1233. Before we package up the vagrant machine into a box, we need to shutdown the vagrant box. The built-in molecule module only had `up` or `destroy`. *fingers-crossed* this gets in upstream and we can tear this out.
See PR ansible/molecule#1233. Before we package up the vagrant machine into a box, we need to shutdown the vagrant box. The built-in molecule module only had `up` or `destroy`. *fingers-crossed* this gets in upstream and we can tear this out.
Our unique changes that were added to support suppressing NFS were recently merged upstream in molecule 2.13: * ansible/molecule#1235 * ansible/molecule#1233
Our unique changes that were added to support suppressing NFS were recently merged upstream in molecule 2.13: * ansible/molecule#1235 * ansible/molecule#1233
Added a
halt
option tostate
to shut-down a VM without deleting it.