--- - name: create AD group become: true # become_method: runas hosts: all tasks: - name: Add a domain user/group to a domain group community.windows.win_domain_group_membership: name: "G-MGMT-LA-DEVADM-{{item}}" domain_username: "{{admin_name}}" domain_password: "{{admin_pass}}" members: - "ADAGILITY\\{{user}}" state: present with_items: "{{ adgroup.split(',') }}"