2021-06-11 15:01:45 +02:00
|
|
|
---
|
2023-05-25 13:48:38 +02:00
|
|
|
- name: add ssh key
|
2024-02-23 12:19:48 +01:00
|
|
|
hosts: "{{ my_hosts | d([]) }}"
|
2021-06-11 15:01:45 +02:00
|
|
|
become: yes
|
|
|
|
tasks:
|
|
|
|
- name: install public keys
|
|
|
|
ansible.posix.authorized_key:
|
|
|
|
user: "{{ lookup('env','USER') }}"
|
|
|
|
state: present
|
2021-09-17 14:12:39 +02:00
|
|
|
key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
|
2021-06-11 15:01:45 +02:00
|
|
|
- name: change sudoers file
|
2024-02-24 11:56:25 +01:00
|
|
|
ansible.builtin.lineinfile:
|
2021-06-11 15:01:45 +02:00
|
|
|
path: /etc/sudoers
|
|
|
|
state: present
|
|
|
|
regexp: '^%sudo'
|
|
|
|
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
|
2024-02-22 19:01:59 +01:00
|
|
|
validate: /usr/sbin/visudo -cf %s
|