You should probably consider the |default feature in Jinja2 for fields you
don't want to define a value for, and as Adam said, specify the UUID.

This should take care of the above concerns.

{{ item.shell | default('/bin/sh') }}

etc






On Sun, Jan 12, 2014 at 11:56 PM, hafizh <[email protected]> wrote:

> Thanks for the reply but I think you guys are missing the point.
>
> The 'user' module I put is just a simple example showing the use cases. To
> make it clearer, it can be 'file' module where I just want to backup one
> file and not the rest, but using the same action for all.
> Also, I do follow the "Best Practice" and using roles, and hence the whole
> discussion because of the limited usability.
>
> @Michael DeHaan, I'm well aware of the use of 'when' but it makes your
> tasks tightly coupled with the 'trigger'. You need to cater for all the
> possibilites.
> It will just clutter the tasks. Say you need to create many users with the
> following requirement:
>  - username, uid, and gid only
>  - above + supplementary group only
>  - above + custom shell only
>  - above + different home only
>  - above + etc...
>
> Then your 'when' condition will become a real sphegetti because Ansible is
> ran in sequence. (Try to make the 'when' logic for that and you will see).
> As far as i know they is no module to skip the subsequent tasks when a
> task is successfull. Off cause you can use 'when' to skip the subsequence
> but that will just make it even more complicated.
>
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Michael DeHaan <[email protected]>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to