24 lines
495 B
YAML
24 lines
495 B
YAML
|
---
|
||
|
- name: Allow passwordless sudo
|
||
|
lineinfile:
|
||
|
path: /etc/sudoers
|
||
|
regexp: '^%sudo'
|
||
|
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
|
||
|
validate: 'visudo -cf %s'
|
||
|
state: present
|
||
|
|
||
|
- name: Add administrators
|
||
|
user:
|
||
|
name: "{{ item }}"
|
||
|
groups: sudo
|
||
|
shell: /bin/bash
|
||
|
state: present
|
||
|
with_items: "{{ users }}"
|
||
|
|
||
|
- name: Add SSH keys
|
||
|
authorized_key:
|
||
|
user: "{{ item }}"
|
||
|
key: "{{ lookup('file', 'files/{{ item }}.pub') }}"
|
||
|
state: present
|
||
|
with_items: "{{ users }}"
|