- block: - name: "Create group for user '{{ user.username }}'." tags: users ansible.builtin.group: name: "{{ user.group | default(user.username) }}" gid: "{{ user.gid | default(omit) }}" state: present when: - user.state | default('present') == 'present'