On Tuesday, November 10, 2015 at 10:34:35 AM UTC+1, r144 wrote:
>
> I want to do something which should be quite easy, but I cannot find out 
> exactly how I should do it.
>

I found a solution, although it's maybe not the best. In case someone is 
interested:

   tasks:
     - name: check currentdir
       stat:     path={{currentdir}}/rails
       register: curstat
     - name: check prevdir
       stat:     path={{prevdir}}/rails
       register: prevstat

     - name: set variable
       set_fact: userdir=''
    
     - name: next prev
       when: prevstat.stat.exists
       set_fact: userdir={{prevstat.stat.path}}
     - name: next current
       when: curstat.stat.exists
       set_fact: userdir={{curstat.stat.path}}

-- 
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/3e626185-154f-43b0-b377-6a0456dc0bd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to