21 lines
489 B
YAML
21 lines
489 B
YAML
# vim: ft=yaml.ansible
|
|
# code: language=ansible
|
|
---
|
|
- name: Add users
|
|
ansible.builtin.user:
|
|
name: "{{ item.name }}"
|
|
comment: "{{ item.comment }}"
|
|
password: "{{ item.password }}"
|
|
groups: "{{ item.groups }}"
|
|
shell: /bin/bash
|
|
update_password: always
|
|
loop: "{{ users }}"
|
|
no_log: true
|
|
|
|
- name: Add ssh authorized_keys
|
|
ansible.posix.authorized_key:
|
|
user: "{{ item.name }}"
|
|
key: "{{ item.ssh_keys | join('\n') }}"
|
|
exclusive: true
|
|
loop: "{{ users }}"
|