mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-25 06:01:04 +01:00
sudo rights for administrator without password and copying of authorized keyes
This commit is contained in:
parent
0c4031ba73
commit
07281e9e49
@ -4,7 +4,7 @@
|
||||
- name: create sudoers
|
||||
template: src=sudoers dest=/etc/sudoers
|
||||
|
||||
- name: ensure group "sudo" exists
|
||||
- name: insure group "sudo" exists
|
||||
group:
|
||||
name: sudo
|
||||
state: present
|
||||
|
@ -4,4 +4,17 @@
|
||||
generate_ssh_key: yes
|
||||
ssh_key_bits: 4096
|
||||
ssh_key_file: .ssh/id_rsa
|
||||
group: sudo
|
||||
group: administrator
|
||||
|
||||
- name: create /home/administrator/.ssh/authorized_keys
|
||||
copy:
|
||||
src: "{{ inventory_dir }}/files/{{ inventory_hostname }}/home/administrator/.ssh/authorized_keys"
|
||||
dest: /home/administrator/.ssh/authorized_keys
|
||||
owner: administrator
|
||||
group: administrator
|
||||
mode: '0644'
|
||||
|
||||
- name: grant administrator sudo rights without password
|
||||
copy:
|
||||
content: '%administrator ALL=(ALL) NOPASSWD: ALL'
|
||||
dest: /etc/sudoers.d/administrator
|
||||
|
Loading…
Reference in New Issue
Block a user