![So funktioniert das Debuggen in Post_Tasks mit Tags](https://rvso.com/image/768910/So%20funktioniert%20das%20Debuggen%20in%20Post_Tasks%20mit%20Tags.png)
site.yml:
---
- hosts: localhost
connection: local
post_tasks:
- name: "List dir"
tags: always
shell: "ls -la"
register: logs_result
- debug:
var: logs_result.stdout_lines
Ausführen:
ansible-playbook -t abc site.yml
Ich kann die Ausgabe nicht sehen. Wie kann ich dafür sorgen, dass debug
es immer funktioniert, unabhängig vom Tag?
Antwort1
Das Hinzufügen tags: always
zur Debug-Aufgabe sollte funktionieren.
- debug:
var: logs_result.stdout_lines
tags: always