From d6e79044efbbfad9ba1b809276baf03284780392 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Thu, 24 May 2018 10:47:29 -0700 Subject: [PATCH] infra: add a gather-ceph-logs.yml playbook MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add a gather-ceph-logs.yml which will log onto all the machines from your inventory and will gather ceph logs. This is not intended to work on containerized environments since the logs are stored in journald. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1582280 Signed-off-by: Sébastien Han --- infrastructure-playbooks/gather-ceph-logs.yml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 infrastructure-playbooks/gather-ceph-logs.yml diff --git a/infrastructure-playbooks/gather-ceph-logs.yml b/infrastructure-playbooks/gather-ceph-logs.yml new file mode 100644 index 000000000..830c2ab83 --- /dev/null +++ b/infrastructure-playbooks/gather-ceph-logs.yml @@ -0,0 +1,42 @@ +- hosts: + - mons + - agents + - osds + - mdss + - rgws + - nfss + - restapis + - rbdmirrors + - clients + - mgrs + - iscsi-gws + - iscsigws + + gather_facts: false + become: yes + + tasks: + - name: create a temp directory + local_action: + module: tempfile + state: directory + prefix: ceph_ansible + run_once: true + register: localtempfile + + - name: set_fact lookup_ceph_config - lookup keys, conf and logs + shell: ls -1 {{ item }} + 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 }}" + dest: "{{ localtempfile.path }}" + fail_on_missing: no + flat: no + with_items: + - "{{ ceph_collect.stdout_lines }}" \ No newline at end of file -- 2.39.5