restructure repo
This commit is contained in:
11
roles/manage-ssh-keys/tasks/add-goodkeys.yml
Normal file
11
roles/manage-ssh-keys/tasks/add-goodkeys.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: Good Keys hinzufügen
|
||||
lineinfile:
|
||||
path: "{{ authorized_keys_file }}"
|
||||
line: "{{ item }}"
|
||||
create: yes
|
||||
state: present
|
||||
with_items: "{{ good_keys }}"
|
||||
notify:
|
||||
- Cleanup Comments
|
||||
- Add Comment
|
||||
12
roles/manage-ssh-keys/tasks/main.yml
Normal file
12
roles/manage-ssh-keys/tasks/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
# Haupt-Task der Rolle: Modularer Aufbau mit Subtasks
|
||||
- name: Validiere SSH Keys
|
||||
import_tasks: validate-authorized-keys.yml
|
||||
|
||||
- name: Füge Good Keys hinzu
|
||||
import_tasks: add-goodkeys.yml
|
||||
when: good_keys
|
||||
|
||||
- name: Entferne Bad Keys
|
||||
import_tasks: remove-badkeys.yml
|
||||
when: bad_keys
|
||||
10
roles/manage-ssh-keys/tasks/remove-badkeys.yml
Normal file
10
roles/manage-ssh-keys/tasks/remove-badkeys.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Bad Keys entfernen
|
||||
lineinfile:
|
||||
path: "{{ authorized_keys_file }}"
|
||||
line: "{{ item }}"
|
||||
state: absent
|
||||
with_items: "{{ bad_keys }}"
|
||||
notify:
|
||||
- Cleanup Comments
|
||||
- Add Comment
|
||||
8
roles/manage-ssh-keys/tasks/validate-authorized-keys.yml
Normal file
8
roles/manage-ssh-keys/tasks/validate-authorized-keys.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Stelle sicher, dass das .ssh-Verzeichnis existiert
|
||||
file:
|
||||
path: "{{ authorized_keys_file | dirname }}"
|
||||
state: directory
|
||||
owner: "{{ ssh_user }}"
|
||||
group: "{{ ssh_user }}"
|
||||
mode: '0700'
|
||||
Reference in New Issue
Block a user