--- - name: Ensure user groups are present become: true group: name: "{{ item }}" state: present with_items: "{{ user_data.groups | default(user_data) }}"