tenks/roles/tenks-diagnostics/tasks/post.yml

25 lines
650 B
YAML

---
- name: Write host variables to a file
copy:
content: "{{ hostvars[inventory_hostname] | to_nice_json }}"
dest: "{{ tenks_diagnostics_log_dir }}/facts.json"
- name: Run diagnostics script
script: get_logs.sh
register: get_logs_result
become: true
failed_when: false
environment:
LOG_DIR: "{{ tenks_diagnostics_log_dir }}"
CONFIG_DIR: "{{ tenks_diagnostics_config_dir }}"
- name: Print get_logs.sh output
debug:
msg: "{{ get_logs_result.stdout }}"
- name: Download logs to executor
synchronize:
src: "{{ tenks_diagnostics_log_dir }}/"
dest: "{{ tenks_diagnostics_executor_log_dir }}/"
mode: pull