SSE-Lab/ansible/roles/docker/tasks/docker_user.yml

24 lines
570 B
YAML

---
- name: Add the docker group
group:
name: docker
gid: 1101
state: present
- name: Add the docker user
user:
name: docker
uid: 1101
group: docker
# Directly generate hash
# https://www.lisenet.com/2019/ansible-generate-crypted-passwords-for-the-user-module/
password: "{{ docker_crypted_password | password_hash('sha512') }}"
shell: /bin/bash
system: yes
home: /srv/docker
state: present
- name: Reset ssh connection to allow user changes to affect ansible user
ansible.builtin.meta:
reset_connection