From 6f471b6dd5428d2e71e79e543563b4104a2bb557 Mon Sep 17 00:00:00 2001 From: Arx Cruz Date: Wed, 4 Jul 2018 07:21:15 -0300 Subject: [PATCH] Switch ansible module command with copy We thought there were a bug in copy command due the fact it wasn't copying the files to logs. Turns out it was the remote_src option that was missed. Change-Id: I1712959f68276162a6e8b6f0a10c80ff3ed94367 --- playbooks/upload-logs.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/playbooks/upload-logs.yaml b/playbooks/upload-logs.yaml index 49b3eab0..5096e6ba 100644 --- a/playbooks/upload-logs.yaml +++ b/playbooks/upload-logs.yaml @@ -4,17 +4,19 @@ file: path: /tmp/logs/tempest state: directory - become: True + become: true - # Using command instead of copy due - # https://github.com/ansible/ansible/issues/42198 - name: Copying tempest logs and config to /tmp/logs/tempest - command: "sudo cp {{ item }} /tmp/logs/tempest" + copy: + src: "{{ item }}" + dest: /tmp/logs/tempest + remote_src: true with_items: - /opt/stack/tempest/etc/tempest.conf - /opt/stack/tempest/tempest.log - /etc/openstack/accounts.yaml - ignore_errors: True + ignore_errors: true + become: true - name: Upload logs synchronize: