EvoBSD/roles/accounts/tasks/user.yml
Patrick Marchand 77269a2c3f Fixed problem with ssh keys
ssh key variable is a list of keys, not a single key. Use a loop
and the authorized keys module to fix this.
2019-01-18 09:30:42 -05:00

22 lines
509 B
YAML

---
- name: "User '{{ user.name }}' is present"
user:
state: present
name: '{{ user.name }}'
uid: '{{ user.uid }}'
password: '{{ user.password_hash_openbsd }}'
groups: wheel
shell: /bin/ksh
append: yes
tags:
- admin
- name: "SSH public keys for '{{ user.name }}' are present"
authorized_key:
user: "{{ user.name }}"
key: "{{ ssk_key }}"
state: present
with_items: "{{ user.ssh_keys }}"
loop_control:
loop_var: ssk_key
when: user.ssh_keys is defined