From 3b7fdd8f6b10544ac56785412af51164d46e9c4a Mon Sep 17 00:00:00 2001 From: Kostiantyn Kalynovskyi Date: Mon, 3 Feb 2020 20:01:43 +0000 Subject: [PATCH] Change libvirt log owner. Fix rsync permission err Change-Id: I6c25e71c22268f1e3b58f1e06907f073a33f09f7 --- .../tasks/main.yml | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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