--- - 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 }}