restructure repo

This commit is contained in:
DerLinkman
2024-11-22 20:25:38 +01:00
parent 5a0f229511
commit 344c9508ea
17 changed files with 184 additions and 43 deletions

View 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

View 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

View 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

View 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'