mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-11-29 11:43:48 +01:00
20 lines
505 B
YAML
20 lines
505 B
YAML
---
|
|
- name: Add ssh key
|
|
hosts: "{{ my_hosts | d([]) }}"
|
|
become: true
|
|
|
|
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
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/sudoers
|
|
state: present
|
|
regexp: '^%sudo'
|
|
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
|
|
validate: /usr/sbin/visudo -cf %s
|