---
- name: Create users
  ansible.builtin.user:
    name: mrwho
    comment: Great and mighty
    #    uid: 1001
    state: present

- name: Add SSH key
  ansible.posix.authorized_key:
    user: mrwho
    state: present
    key: "{{ item }}"
  with_file:
    - mrwho.ssh.pub

- name: Add to sudoers
  community.general.sudoers:
    name: mrwho
    user: mrwho
    commands: ALL
    state: present

- name: Update mrwho .bashrc
  ansible.builtin.template:
    src: .bashrc.j2
    dest: /home/mrwho/.bashrc
    owner: mrwho
    mode: "0644"
#    group: mrwho

# - name: Update root .bashrc
#   template:
#     src: .bashrc.j2
#     dest: /root/.bashrc
#     owner: root
#     group: root
