---
# Forked from imaging/driving_os/roles/zoox_user
- name: Ensure zoox group exists
  group:
    name: zoox
  become: yes

- name: Create zoox user account
  user:
    name: zoox
    password: "{{ lookup('hashi_vault', 'secret=ingest-kiosk/data/ssh url=https://vault-rsi.zooxlabs.com:8200').data.ansible_user_pass | password_hash('sha512') }}"
    group: zoox
    groups: adm,sudo,plugdev
    append: yes
    shell: /bin/bash
  become: yes

- name: Update become password
  set_fact:
    ansible_become_pass: "{{ lookup('hashi_vault', 'secret=ingest-kiosk/data/ssh url=https://vault-rsi.zooxlabs.com:8200').data.ansible_user_pass }}"
