mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Removed server_ for better overview
This commit is contained in:
6
roles/user-administrator/Readme.md
Normal file
6
roles/user-administrator/Readme.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Role Administrator
|
||||
This role creates an standard administrator user.
|
||||
This user needs to type in his password before executing sudo.
|
||||
For security reasons it's recommended to use this user instead of the standard root user.
|
||||
This user should not be used to login to other systems. It's just there to let administration tasks run.
|
||||
For this reason no ssh-keys are generated.
|
1
roles/user-administrator/files/administrator
Normal file
1
roles/user-administrator/files/administrator
Normal file
@@ -0,0 +1 @@
|
||||
administrator ALL=(ALL) ALL
|
3
roles/user-administrator/meta/main.yml
Normal file
3
roles/user-administrator/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
dependencies:
|
||||
- server_native-sudo
|
||||
- independent_user-administrator
|
24
roles/user-administrator/tasks/main.yml
Normal file
24
roles/user-administrator/tasks/main.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
- name: create {{path_administrator_home}}.ssh/authorized_keys
|
||||
copy:
|
||||
src: "{{ inventory_dir }}/files/{{ inventory_hostname }}{{path_administrator_home}}.ssh/authorized_keys"
|
||||
dest: "{{path_administrator_home}}.ssh/authorized_keys"
|
||||
owner: administrator
|
||||
group: administrator
|
||||
mode: '0644'
|
||||
|
||||
- name: grant administrator sudo rights with password
|
||||
copy:
|
||||
src: "administrator"
|
||||
dest: /etc/sudoers.d/administrator
|
||||
mode: '0644'
|
||||
owner: root
|
||||
group: root
|
||||
notify: sshd restart
|
||||
|
||||
- name: "create {{path_administrator_home}}volumes/"
|
||||
file:
|
||||
path: "{{path_administrator_home}}volumes"
|
||||
state: directory
|
||||
owner: administrator
|
||||
group: administrator
|
||||
mode: 0700
|
Reference in New Issue
Block a user