diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-08-22 15:52:21 +0800 |
---|---|---|
committer | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-08-22 15:55:16 +0800 |
commit | c6d9fcbffa0146ef968be0594b4c1afe98c3ee57 (patch) | |
tree | 6d079198db602435658c5188148ab15163673a28 /resources/ansible_roles/ceph-info/tasks/disk.yml | |
parent | 5041eb2f128eb2c9bb3c1715a4442fa5605eee6e (diff) |
Merge ceph info roles
Change-Id: I83be70cf24be2a9da0a0f82e44810b1e9ff2b3b8
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'resources/ansible_roles/ceph-info/tasks/disk.yml')
-rw-r--r-- | resources/ansible_roles/ceph-info/tasks/disk.yml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/resources/ansible_roles/ceph-info/tasks/disk.yml b/resources/ansible_roles/ceph-info/tasks/disk.yml new file mode 100644 index 00000000..6bb88e69 --- /dev/null +++ b/resources/ansible_roles/ceph-info/tasks/disk.yml @@ -0,0 +1,43 @@ +############################################################################## +# Copyright (c) 2017 ZTE Corporation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +- name: get ceph disk information + become: true + command: ceph-disk list + register: ceph_disk_out + +- name: saving output to log + copy: + content: "{{ ceph_disk_out.stdout }}" + dest: "{{ logfile }}" + delegate_to: localhost + +- name: get ceph journal information + become: true + shell: lsblk -d -o name,rota |awk '{if ($2 == 0) printf "%s SSD \n",$1 }' + register: ceph_journal_out + +- name: append + lineinfile: + dest: "{{ logfile }}" + line: "{{ ceph_journal_out.stdout }}" + insertafter: EOF + delegate_to: localhost + +- name: get ceph report + become: true + command: ceph report + register: ceph_report_out + +- name: saving ceph report to log + copy: + content: "{{ ceph_report_out.stdout }}" + dest: "{{ output }}/ceph_report.json" + delegate_to: localhost |