You could use the stat action as well which returns a handy exists boolean.
http://docs.ansible.com/stat_module.html

- stat: path=YOURPATH
  register: grailsinstalled

- other_action: too
  when: grailsinstalled.stat.exists

Typing on my phone, so please excuse typos :-)
Am 01.12.2014 07:24 schrieb "Tze Yang Ng" <[email protected]>:

> Hi,
>
> Thanks!!! I wish i see this earlier, i ended up solve the issue just now
> and then your post showed up. Seem like there are some delay for the post
> to show-up. Just to share my solution as well for reference.
>   - name: gvm | Install gvm prerequisites for Grails
>     shell:
>       curl -s get.gvmtool.net | bash executable: /bin/bash
>     sudo: no
>     tags: grails
>
>   - name: gvm set source | Set source for gvm
>     shell:
>       source "/home/vagrant/.gvm/bin/gvm-init.sh" && yes | gvm install
> grails 2.3.7 executable: /bin/bash
>     sudo: no
>     tags: grails
>
>
>
> On Sunday, November 30, 2014 4:54:15 PM UTC-6, rxdazn wrote:
>>
>> About the yes command, I meant yes | gvm install grails rather than gvm
>> install grails | yes, sorry!
>>
>> On Sunday, November 30, 2014 6:53:27 PM UTC+1, Tze Yang Ng wrote:
>>>
>>> Hi,
>>>
>>> I managed to get further with the following:
>>>
>>>   - name: Set Home | Set to vagrant home before install Grails
>>>     shell:
>>>       cd /home/vagrant executable: /bin/bash
>>>     sudo: no
>>>     tags: grails
>>>
>>>   - name: gvm | Install gvm prerequisites for Grails
>>>     shell:
>>>       curl -s get.gvmtool.net | bash executable: /bin/bash
>>>     sudo: no
>>>     tags: grails
>>>
>>>   - name: gvm set source | Set source for gvm
>>>     shell:
>>>       source "/home/vagrant/.gvm/bin/gvm-init.sh" executable: /bin/bash
>>>     sudo: no
>>>     tags: grails
>>>
>>>   - name: grails | install grails 2.3.7
>>>     shell:
>>>       gvm install grails 2.3.7 executable: /bin/bash
>>>     sudo: yes
>>>     tags: grails
>>>
>>>
>>> but it still failed at the last command: gvm install
>>>
>>> TASK: [grails | install grails 2.3.7] ******************************
>>> ***********
>>>
>>> failed: [default] => {"changed": true, "cmd": "gvm install grails
>>> 2.3.7", "delta": "0:00:00.003756", "end": "2014-11-30 17:43:51.951141",
>>> "rc": 127, "start": "2014-11-30 17:43:51.947385", "warnings": []}
>>>
>>> stderr: /bin/bash: gvm: command not found
>>>
>>> FATAL: all hosts have already failed -- aborting
>>>
>>>
>>> Any advice? Also how to press "y" at the end of the installation using
>>> playbook?
>>> thanks.
>>>
>>>
>>> On Wednesday, November 26, 2014 11:18:00 PM UTC-6, Tze Yang Ng wrote:
>>>>
>>>> Hi,
>>>>
>>>> Trying to use ansible to install GVM and Grails, but can't seem to make
>>>> it work, anyone can help? Tried both shell and command, but none seem work.
>>>>
>>>>  - name: gvm | Install gvm prerequisites for Grails
>>>>     shell:
>>>>       curl -s get.gvmtool.net | bash
>>>>     sudo: yes
>>>>     tags: grails
>>>>   - name: gvm set source | Set source for gvm
>>>>     shell:
>>>>       source "/home/vagrant/.gvm/bin/gvm-init.sh"
>>>>     sudo: yes
>>>>     tags: grails
>>>>   - name: grails | install grails 2.3.7
>>>>     command:
>>>>       gvm install grails 2.3.7
>>>>     sudo: yes
>>>>     tags: grails
>>>>
>>>> thanks.
>>>>
>>>  --
> 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/0c4abdcd-0fe1-4d94-8312-5a56f1d5c20b%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/0c4abdcd-0fe1-4d94-8312-5a56f1d5c20b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAK8jvqz1120vUiW2yBS%2Bq9C8EWsSFW2cgVbtXhN%2BxQHoEs_%3D6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to