diff --git a/playbooks/gather-logs.yml b/playbooks/gather-logs.yml index 2a722c0..967143f 100644 --- a/playbooks/gather-logs.yml +++ b/playbooks/gather-logs.yml @@ -2,6 +2,14 @@ hosts: all gather_facts: True tasks: + - name: CFME | Gather Logs | Set logs to gather + set_fact: + cfme_gather_logs_list: + - evm.log + - automation.log + - top_output.log + when: cfme_gather_logs_list is not defined + - name: CFME | Gather Logs | Set destination host set_fact: cfme_gather_logs_destination_host: "{{ groups['cfme-databases'][0] }}" @@ -46,9 +54,7 @@ src: "/var/www/miq/vmdb/log/{{ item }}" dest: "{{ cfme_gather_logs_destination_dir }}/{{ item }}-{{ inventory_hostname }}" delegate_to: "{{ cfme_gather_logs_destination_host }}" - with_items: - - evm.log - - automation.log + with_items: "{{ cfme_gather_logs_list }}" - name: CFME | Gather Logs | Create archive archive: @@ -57,6 +63,12 @@ run_once: True delegate_to: "{{ cfme_gather_logs_destination_host }}" + - name: CFME | Gather Logs | Archive location + debug: + msg: "{{ cfme_gather_logs_destination_dir }}.tgz" + run_once: True + delegate_to: "{{ cfme_gather_logs_destination_host }}" + - name: CFME | Gather Logs | Send email with logs attached mail: host: "{{ cfme_gather_logs_smtp_host }}" @@ -74,6 +86,7 @@ - "cfme_gather_logs_smtp_port is defined" - "cfme_gather_logs_email_from is defined" - "cfme_gather_logs_email_to is defined" + ignore_errors: True - name: CFME | Gather Logs | Delete destination directory file: