Hi Raja
I struggled with this, and the approach I settled with is to duplicate the task, having one with the 'sudo:' parameter and one without, and each having a 'when:' conditional.
- command: something
sudo: yes
when: env == 'development'
- command: something
when: env != 'development'
Hope this helps
Tom
--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cd3109da-57f5-4c0a-9812-29742c81726b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--