lab-ansible/roles/common/tasks/users.yml
2023-11-05 19:08:26 +01:00

19 lines
429 B
YAML

# vim: ft=yaml.ansible
# code: language=ansible
---
- name: Add users
ansible.builtin.user:
name: "{{ item.name }}"
comment: "{{ item.comment }}"
groups: "{{ item.groups }}"
shell: /bin/bash
state: present
loop: "{{ users }}"
- name: Add ssh authorized_keys
ansible.posix.authorized_key:
user: "{{ item.name }}"
key: "{{ item.ssh_keys | join('\n') }}"
exclusive: true
loop: "{{ users }}"