From 917cccf84fe7d45731adb3ccd7d4a127d925c8df Mon Sep 17 00:00:00 2001 From: David Galloway Date: Wed, 24 Jul 2019 10:03:09 -0400 Subject: [PATCH] tools: Non-working playbook Signed-off-by: David Galloway --- tools/lrc-pg-smart.yml | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tools/lrc-pg-smart.yml diff --git a/tools/lrc-pg-smart.yml b/tools/lrc-pg-smart.yml new file mode 100644 index 00000000..707f9cab --- /dev/null +++ b/tools/lrc-pg-smart.yml @@ -0,0 +1,44 @@ +--- +### This standalone playbook can be used to check SMART data on long_running_cluster hosts that have a bad PG + +- hosts: + - long_running_cluster + become: true + gather_facts: false + tasks: + + # We need to leave /.cephlab_rc_local or else each FOG reimage would tell Cobbler to run ceph-cm-ansible + - name: Get bad PG IDs + shell: "ceph health detail | grep \"active+clean+inconsistent\" | awk '{ print $2 }'" + register: pg_output + delegate_to: reesi001.front.sepia.ceph.com + + - debug: var=pg_output + + - name: Find OSD IDs + shell: "ceph pg {{ item }} query | jq -r '.acting[]'" + register: osd_ids + with_items: "{{ pg_output.stdout_lines }}" +# with_items: "{{ pg_output.stdout_lines }}" + with_items: + - 4.2 + - 4.3 + + - debug: var=osd_ids.results + + - set_fact: + combined_osd_ids: "{{ combined_osd_ids | default([]) | union(item.stdout_lines) }}" + with_items: "{{ osd_ids.results }}" +# combined_osd_ids: "{{ osd_ids.results|map(attribute='stdout_lines')|list }}" +# combined_osd_ids: [] + +# - name: Combine OSD IDs +# set_fact: +# combined_osd_ids: "{{ combined_osd_ids + item }}" +# with_items: "{{ osd_ids.results|map(attribute='stdout_lines')|list }}" +# combined_osd_ids: "{{ osd_ids.results | map(attribute='stdout') | join('\n') }}" +# combined_osd_ids: "{{ combined_osd_ids + item.stdout_lines }}" +# when: item.rc == 0 +# with_items: "{{ osd_ids.results }}" + + - debug: var=combined_osd_ids -- 2.47.3