blob: 887da0abd45278c2463c75899bd77bef9ddc7c2e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
---
- name: install sudo
apt:
name: sudo
state: present
- name: add admin users
with_items: "{{ admin_user_group | default([]) | union(admin_user_host | default([])) }}"
user:
name: "{{ item.name }}"
state: present
password: "{{ item.password | default(omit) }}"
groups:
- sudo
- adm
append: yes
shell: "{{ item.shell | default(omit) }}"
- name: install ssh keys for admin users
with_items: "{{ admin_user_group | default([]) | union(admin_user_host | default([])) }}"
authorized_key:
user: "{{ item.name }}"
key: "{{ item.ssh_keys | join('\n') }}"
exclusive: yes
|