Files
basic-role/tasks/users.yml
Emmanouil Kampitakis 6b398a83fb Migrate to collections
2021-05-21 16:22:14 +02:00

18 lines
456 B
YAML

---
- name: "Add users"
user:
name: "{{ os_user.name }}"
comment: "{{ os_user.comment }}"
uid: "{{ os_user.uid }}"
shell: "{{ os_user.shell }}"
groups: "{{ os_user.groups }}"
state: "{{ os_user.state | default('present') }}"
become: true
- name: Copy local ssh key to authorized keys file
ansible.posix.authorized_key:
user: "{{ os_user.name }}"
key: "{{ item }}"
loop: "{{ os_user.ssh_auth_keys }}"
become: true