---

- name: set group IDs
  become: yes
  group:
    name: "{{ item.1 }}"
    state: present
    # Make GIDs consistent across the cluster so SLURM is happy
    gid: "{{ 1200+item.0 }}"
  with_indexed_items: "{{ temporary_users }}"

- name: add users
  become: yes
  user:
    name: "{{ item.1 }}"
    state: present
    password: '$6$yLoencixWigQL1$guyBmlBpiMcPHLflBUB24S/kExO8WLAifA9s8H/qBjvr3RONMkzXRXYPsyE5p6AKksLUnrte1nXXpCleglrxG0'
    # Make UIDs consistent across the cluster so SLURM is happy
    uid: "{{ 1200+item.0 }}"
    # What groups do we actually want?
    group: "{{ item.1 }}"
    groups: sudo,docker
    shell: /bin/bash
  with_indexed_items: "{{ temporary_users }}"
