diff --git a/roles/airship-gather-libvirt-logs/tasks/main.yml b/roles/airship-gather-libvirt-logs/tasks/main.yml index 0003b09..d7f947f 100644 --- a/roles/airship-gather-libvirt-logs/tasks/main.yml +++ b/roles/airship-gather-libvirt-logs/tasks/main.yml @@ -7,14 +7,14 @@ state: directory path: "{{ libvirt_log_dir }}" -- name: copy hypervisor logs to tmp directory - command: "cp -r /var/log/libvirt {{ libvirt_log_dir }}/libvirt-hypervisor" - become: true - ignore_errors: True - - name: collect all libvirt logs and resources + ignore_errors: True block: + - name: copy hypervisor logs to tmp directory + command: "cp -r /var/log/libvirt {{ libvirt_log_dir }}/libvirt-hypervisor" + become: true + - name: copy console logs to tmp directory command: "cp -r /var/log/libvirt-consoles/ {{ libvirt_log_dir }}/libvirt-consoles" become: true @@ -84,9 +84,15 @@ args: executable: /bin/bash - - name: "Downloads logs to executor" + - name: Change ownership of the logs dir + file: + state: directory + recurse: true + owner: "{{ ansible_user }}" + become: true + + - name: Downloads logs to executor synchronize: src: "{{ libvirt_log_dir }}" dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}" mode: pull - ignore_errors: True \ No newline at end of file