Hi Phil, I tried what you said, I declared secondary groups variable as *secondary_groups: []* in the users.yml file at the vars directory and then, on the main file for the task, I just defined *when: (item.1 != "")* and indeed, action is only executed when the secondary groups were assigned for the user and if the user does not have any secondary group assigned it does not do anything, what it is expected.
Thank you very much for your help :) Cheers, Esteban El sábado, 30 de mayo de 2015, 16:44:33 (UTC+2), Esteban Freire escribió: > > Hi Phil, > > Thank you very much for your help! > > On Monday, I will try to declare *secondary_groups: []* and I will also > try put this conditional *when: item.1 != "" *because I only want that > the action/command is just executed when secondary_groups really contains > some secondary groups to assign to the users. > > I will let you know by Monday :) > > Thanks in advance, > Esteban > > El sábado, 30 de mayo de 2015, 15:59:31 (UTC+2), Philippe Eveque escribió: >> >> yep >> >> Phil >> >> 2015-05-30 15:51 GMT+02:00 Esteban Freire <[email protected]>: >> >>> Hi Phil, >>> >>> Thank you very much for your answer :) >>> >>> Unfortunatelly, I cannot try it until Monday but I will let you know if >>> it works. Also, I understand that I must set up secondary_groups: [] in the >>> user.yml file situated on the vars directory when an user does not have >>> secondary groups assigned, right? or am I understand it wrong? >>> >>> Thanks in advance, >>> Esteban >>> >>> >>> El sábado, 30 de mayo de 2015, 10:37:18 (UTC+2), Philippe Eveque >>> escribió: >>>> >>>> HI >>>> >>>> you need an empty list >>>> something along the following should help: >>>> >>>> secondary_groups: [] >>>> >>>> Phil >>>> >>>> >>>> -- >>> 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/f0d87c7d-ade4-42ec-9e9f-5f1eb6966eb7%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/ansible-project/f0d87c7d-ade4-42ec-9e9f-5f1eb6966eb7%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- 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/0b811963-b397-4db3-8d2e-e5a97bb2f88a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
