44 lines
876 B
Markdown
44 lines
876 B
Markdown
# role_users
|
|
|
|
Deploy users, groups, sudoers and ssh authorized_keys.
|
|
|
|
## inventory.yml
|
|
|
|
```yaml
|
|
---
|
|
|
|
all:
|
|
hosts:
|
|
host1.ykn.local:
|
|
```
|
|
|
|
## host_vars/host1.ykn.local.yml
|
|
|
|
```yaml
|
|
---
|
|
|
|
users: []
|
|
- name: ansible
|
|
comment: "Ansible user"
|
|
update_password: on_create
|
|
password_lock: true
|
|
append: true
|
|
shell: /bin/bash
|
|
groups: ["sudo"]
|
|
extras:
|
|
authorized_keys:
|
|
- ssh-ed25519 <key> ansible
|
|
- ssh-ed25519 <key> bot_ansible
|
|
sudoers: ansible ALL=(ALL) NOPASSWD:ALL
|
|
- name: flast
|
|
comment: First LAST
|
|
password: <https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html#parameter-password>
|
|
password_lock: false
|
|
shell: /bin/bash
|
|
groups: ["sudo", "adm"]
|
|
extras:
|
|
authorized_keys:
|
|
- ssh-ed25519 <key> flast@computer1
|
|
- ssh-ed25519 <key> flast@computer2
|
|
```
|