I did create the small task. However, for defining variable (num, numami) in the same task is not working.
e.g tasks: - name: Condition statement shell: date_string=`date +%d%b%G`; num=3; numami=5; when: $numami > $num echo Hi; On Monday, January 30, 2017 at 7:59:33 PM UTC+5:30, Brian Coca wrote: > > Just add a when to the tasks you want in the 'if' > when: arg1 > 5 > > for the 'else' just use the opposite condition. > > when: arg1 <=5 > > ---------- > Brian Coca > -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c0f185b8-1eac-44e4-9dff-6d9896d93ab0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.