mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-11-28 19:23:22 +01:00
17 lines
449 B
YAML
17 lines
449 B
YAML
---
|
|
- name: add ssh key
|
|
hosts: "{{ hosts }}"
|
|
become: yes
|
|
tasks:
|
|
- name: install public keys
|
|
ansible.posix.authorized_key:
|
|
user: "{{ lookup('env','USER') }}"
|
|
state: present
|
|
key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
|
|
- name: change sudoers file
|
|
lineinfile:
|
|
path: /etc/sudoers
|
|
state: present
|
|
regexp: '^%sudo'
|
|
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
|
|
validate: /usr/sbin/visudo -cf %s |