]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
gather-ceph-logs: fix logs list generation
authorDimitri Savineau <dsavinea@redhat.com>
Mon, 13 May 2019 14:12:42 +0000 (10:12 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 13 May 2019 14:23:05 +0000 (16:23 +0200)
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 <dsavinea@redhat.com>
infrastructure-playbooks/gather-ceph-logs.yml

index 830c2ab831b082f2fa9e12299db2f333a223b5a3..80867cad3cb18094f59d6421328378b87458cba1 100644 (file)
         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