Hi Eric,

if you don't mind installing an extra plugin, then vagrant-triggers might
be your friend:
https://github.com/emyl/vagrant-triggers

If it's only for that simple case (i.e. detecting "up", but no other state
transitition depedencies), then parsing the commandline args via ARGV[0]
might be good enough:
http://stackoverflow.com/a/20892216/2388971

Cheers,
Torben

On Tue, Oct 18, 2016 at 4:26 PM, Eric Keller <keller.e...@gmail.com> wrote:

> Hi everyone,
>
> Vagrant version
> Vagrant 1.8.4
>
> *Host operating system*
>
> NAME="Ubuntu"
> VERSION="16.04.1 LTS (Xenial Xerus)"
> ID=ubuntu
> ID_LIKE=debian
> PRETTY_NAME="Ubuntu 16.04.1 LTS"
> VERSION_ID="16.04"
> HOME_URL="http://www.ubuntu.com/";
> SUPPORT_URL="http://help.ubuntu.com/";
> BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/";
> UBUNTU_CODENAME=xenial
>
> *Guest operating system*
>
> jessie libvirt
>
> Vagrantfile
>
> # automatically restart dnsmasq in the right order
> # this is a hack until libvirt do not mess-up with dnsmasq.service!
> system('./restart_dns.sh --force')
> ...
> normal multi-box vagrantfile
> ...
> I would like to reset the dns only when calling vagrant up therefore I
> would like to know if I can detect the parameter with wich vagrant is
> called?
>
> for example:
>
> vagrant *up* => in the Vagrantfile I would like to get the "*up*" as a
> variable I can put some condition on.
>
> Best Regards
>
> --
> Eric
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/vagrant-up/38be2b91-566a-4f2b-9d58-a06f8fc1440b%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/38be2b91-566a-4f2b-9d58-a06f8fc1440b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CACN%2Ba_Zuc95fZNCRYciMaear7HR_URtDwjvykZW_PNmqw%3DGKkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to