ansible/roles/ubuntu_base/tasks/users.yml

18 lines
446 B
YAML

# vim: ft=yaml.ansible
---
- name: "Add users"
user:
name: "{{ item.name }}"
comment: "{{ item.comment }}"
password: "{{ item.password }}"
groups: "{{ item.groups }}"
update_password: "always"
loop: "{{ users | default([]) }}"
- name: "Add ssh authorized_keys"
ansible.posix.authorized_key:
user: "{{ item.name }}"
key: "{{ item.ssh_keys | join('\n') }}"
exclusive: true
loop: "{{ users | default([]) }}"