---
- name: Ensure users exists
  user:
    name: "{{ item.name }}"
    shell: /bin/zsh
    home: "/{{ users_home_base }}/{{ item.name }}"
    groups: "{{ item.groups }}"
    password: "{{ item.password }}"
  with_items:
    - "{{ users }}"
  when:
    - users is defined
  # no_log: yes
  tags:
    - users

- name: Set root password
  user:
    name: root
    password: "{{ root_password }}"
  no_log: yes
  tags:
    - users

- name: Clean up users
  user:
    name: "{{ item }}"
    state: absent
    remove: yes
  with_items:
    - "cinnamon"
    - "cinnemon"
  tags:
    - users

---
- name: Ensure users exists
  become: true
  user:
    name: "{{ item.name }}"
    shell: /bin/zsh
    home: "/{{ users_home_base }}/{{ item.name }}"
    groups: "{{ item.groups }}"
    password: "{{ item.password }}"
  with_items:
    - "{{ users }}"
  when:
    - users is defined
  # no_log: yes
  tags:
    - users

- name: Set root password
  become: true
  user:
    name: root
    password: "{{ root_password }}"
  no_log: yes
  tags:
    - users

- name: Clean up users
  become: true
  user:
    name: "{{ item }}"
    state: absent
    remove: yes
  with_items:
    - "cinnamon"
    - "cinnemon"
    - "pi"
  tags:
    - users

Set tasks to become, remove pi user
Set tasks to become, remove pi user
