On Tue, Jul 07, 2015 at 01:13:59PM +0100, Nigel Metheringham wrote:
>    The virtualisation will change depending on what vagrant provider you use
>    - and you people may use virtualbox without vagrant.
> 
>    I suspect that there are a few signals that can be used to pick out
>    vagrant - specifically I am thinking of ansible being run from vagrant
>    provision rather than other access to a vagrant produced box:-

I assume that below solution isn't the most elegant one, but what
about it?

- name: Check if I'm in a vagrant environment
  stat: path=/vagrant/Vagrantfile
  register: checkVagrant

- name: Let's do something if Vagrant is here
  debug: msg="do something here"
  when: checkVagrant.stat.exists

-- 
Adrià García-Alzórriz
0x09494C14
Una retirada a tiempo es una victoria. 

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20150707124544.GA3968%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: Digital signature

Reply via email to