Restructured role manage-ssh-keys

This commit is contained in:
Ansible Servercow
2024-11-21 16:05:54 +01:00
parent b854e41745
commit 07b21314ef
5 changed files with 49 additions and 32 deletions

View File

@@ -0,0 +1,15 @@
---
- name: Cleanup and add timestamp
block:
- name: Kommentare aus der Datei entfernen
lineinfile:
path: "{{ authorized_keys_file }}"
state: absent
regexp: '^#.*$'
- name: Kommentar hinzufügen (Modified by Ansible)
blockinfile:
path: "{{ authorized_keys_file }}"
marker: ""
block: |
# Modified by Ansible on {{ ansible_date_time.date }} at {{ ansible_date_time.time }}