Detect machine state in a Vagrantfile for triggers

18 views
Skip to first unread message

Iain Hallam

unread,
Jul 28, 2017, 10:04:28 AM7/28/17
to Vagrant
I've just posted a question over at Serverfault: https://serverfault.com/questions/865699/detect-machine-state-in-a-vagrantfile-for-triggers

I'm aiming to use some Ruby in a Vagrantfile to see what state the machine is in to decide which steps are needed in a trigger.before :destroy action.

Not being a Ruby programmer, I'm having some difficulty working out what code I'll need to use to access the state of the machine (or machines) in the Vagrantfile; can anyone help, please?

Thanks,

Iain.

Alvaro Miranda Aguilera

unread,
Jul 28, 2017, 12:52:25 PM7/28/17
to vagra...@googlegroups.com
hello 

there is a plugin called vagrant triggers


have you seen it?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/4bb2b973-966a-481d-a2c1-4ec10f43229a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Iain Hallam

unread,
Jul 28, 2017, 2:36:20 PM7/28/17
to Vagrant
On Friday, 28 July 2017 17:52:25 UTC+1, Alvaro Miranda Aguilera wrote:
there is a plugin called vagrant triggers


have you seen it?

That's exactly what I'm using. The triggers are working fine, but I want to be able to vary my actions based on whether the VM is running or not.

Thanks,

Iain. 
Reply all
Reply to author
Forward
0 new messages