How might I go about excluding one item found under with_items?

For example, assume the following:
ok: [mytestserver] => {
    "aduser": {
        "account_locked": false,
        "attempts": 1,
        "changed": false,
        "city": "Spanish Fork",
        "company": "My Test Company",
        "country": "US",
        "description": "Regular User",
        "distinguished_name": "CN=Gomer 
Pyle,OU=Administration,DC=MyTestCo,DC=com",
        "email": "gp...@mytestco.com",
        "enabled": true,
        "failed": false,
        "firstname": "Gomer",
        "groups": [
            "Domain Users",
            "IT Admins",
            "Citrix",
            "Misc"

I would like to remove the above user from all groups, except for "Domain 
Users".... Unsure how to approach it in this scenario:
  tasks:
    - name: "Disable non-vip user {{ user }}"
      win_domain_user:
        name: "{{ user }}"
        password: $1$SomeSalt$tNt/ObWy40s.iTT/tmGYV.
        account_locked: yes
        groups: "{{ item }}"
        groups_action: remove
      with_items:
        - aduser.groups


-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/77c7b36a-fbf3-4087-ad2a-8e469be0e063%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to