19 lines
429 B
YAML
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 }}"
|