Im unclear on what you want, but `when` executes PER loop iteration,
so you can check `item` and skip that iteration depending on the
condition you want.
I should clarify a little. I want to remove all groups except “Domain Users” from the user specified. I am also already using a when statement:
tasks:- name: “Disable non-vip user {{ user }}”win_domain_user:name: “{{ user }}”password: $1$SomeSalt$tNt/ObWy40s.iTT/tmGYV.account_locked: yesgroups: “{{ item }}”groups_action: removewith_items:- aduser.groupswhen:- not vip`
I re-read you response Brian… I should be able to append to my when statement with an and statement or something similar. I will have to go and test it out.
I re-read you response Brian… I should be able to append to my when statement with an and statement or something similar. I will have to go and test it out.
Wow, I totally missed that. That should do exactly what I want to. Thank you!