# Add the group to the netapp - name: Add group to netapp debug: msg: "vserver services name-service unix-group create -vserver ITSOBulkData01 -name {{ item }} -id {{ account_groups | selectattr('group', 'equalto', item) }} " loop: "{{ netapp_groups }}" when: account_groups | selectattr("group", "equalto", item) loop_control: label: "{{ item.username }}"