fixing handler

This commit is contained in:
Ansible Servercow
2024-11-21 16:12:20 +01:00
parent a2913d8fd7
commit ba83e096b8
3 changed files with 15 additions and 15 deletions

View File

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

View File

@@ -7,4 +7,5 @@
state: present state: present
with_items: "{{ good_keys }}" with_items: "{{ good_keys }}"
notify: notify:
- Cleanup and add timestamp - Cleanup Comments
- Add Comment

View File

@@ -6,4 +6,5 @@
state: absent state: absent
with_items: "{{ bad_keys }}" with_items: "{{ bad_keys }}"
notify: notify:
- Cleanup and add timestamp - Cleanup Comments
- Add Comment