ansible-role-system/tasks/users.yml

18 lines
500 B
YAML

---
# vim: set et sw=2 sts=2 ts=2:
- name: 'setup default user(s)'
with_items: '{{sys_default_users}}'
user:
name: '{{item.name}}'
home: '{{item.home | default("/home/"+item.name)}}'
shell: '{{item.shell | default("/usr/bin/zsh")}}'
groups: '{{item.groups | default([users])}}'
createhome: yes
move_home: yes
append: yes
- name: 'user-defined authorized_keys'
with_items: '{{sys_default_users}}'
ansible.posix.authorized_key:
user: '{{item.name}}'