From: Dimitri Savineau Date: Mon, 13 May 2019 14:12:42 +0000 (-0400) Subject: gather-ceph-logs: fix logs list generation X-Git-Tag: v5.0.0alpha1~348 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ea1f8f551cafd3dcd23435630d231811d8cb0e15;p=ceph-ansible.git gather-ceph-logs: fix logs list generation The shell module doesn't have a stdout_lines attributes. Instead of using the shell module, we can use the find modules. Also adding `become: false` to the local tmp directory creation otherwise we won't have enough right to fetch the files into this directory. Resolves: #3966 Signed-off-by: Dimitri Savineau --- diff --git a/infrastructure-playbooks/gather-ceph-logs.yml b/infrastructure-playbooks/gather-ceph-logs.yml index 830c2ab83..80867cad3 100644 --- a/infrastructure-playbooks/gather-ceph-logs.yml +++ b/infrastructure-playbooks/gather-ceph-logs.yml @@ -23,20 +23,19 @@ prefix: ceph_ansible run_once: true register: localtempfile + become: false - name: set_fact lookup_ceph_config - lookup keys, conf and logs - shell: ls -1 {{ item }} + find: + paths: + - /etc/ceph + - /var/log/ceph register: ceph_collect - changed_when: false - with_items: - - /etc/ceph/* - - /var/log/ceph/* - name: collect ceph logs, config and keys in "{{ localtempfile.path }}" on the machine running ansible fetch: - src: "{{ item }}" + src: "{{ item.path }}" dest: "{{ localtempfile.path }}" fail_on_missing: no flat: no - with_items: - - "{{ ceph_collect.stdout_lines }}" \ No newline at end of file + with_items: "{{ ceph_collect.files }}" \ No newline at end of file