Meh, Im bad at giving example. It's not 'file' module but 'copy' module. What i wanted to say is like this 1 just want to specify 'backup=yes' for 1 file only and use the default for the rest(dont want to specify 'backup=no')
On Monday, January 13, 2014 12:56:55 PM UTC+8, hafizh 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.
