aboutsummaryrefslogtreecommitdiffstats
path: root/resources/ansible_roles/ceph-disk-info
diff options
context:
space:
mode:
authorzhifeng.jiang <jiang.zhifeng@zte.com.cn>2017-07-15 23:51:35 -0700
committerzhifeng.jiang <jiang.zhifeng@zte.com.cn>2017-07-18 00:07:45 -0700
commita2ab51685317a390c02b53153d952786c3afa79e (patch)
treeb2c57f5ce00ede021a481f764be13a1d56aab151 /resources/ansible_roles/ceph-disk-info
parent5e72fe064674a69fed1d2d52d63207675b66832d (diff)
Add ceph-disk-info role to get the ceph disk and journal info from ceph
nodes. JIRA: QTIP-254 Change-Id: Iee21ea600abef6f889ba4c3b5f71fd6fb96f570b Signed-off-by: zhifeng.jiang <jiang.zhifeng@zte.com.cn>
Diffstat (limited to 'resources/ansible_roles/ceph-disk-info')
-rw-r--r--resources/ansible_roles/ceph-disk-info/meta/main.yml14
-rw-r--r--resources/ansible_roles/ceph-disk-info/tasks/main.yml40
2 files changed, 54 insertions, 0 deletions
diff --git a/resources/ansible_roles/ceph-disk-info/meta/main.yml b/resources/ansible_roles/ceph-disk-info/meta/main.yml
new file mode 100644
index 00000000..dbfbfb3b
--- /dev/null
+++ b/resources/ansible_roles/ceph-disk-info/meta/main.yml
@@ -0,0 +1,14 @@
+##############################################################################
+# 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
+##############################################################################
+
+---
+
+allow_duplicates: yes
+dependencies:
+ - { role: qtip-common, basename: ceph-disk-info }
diff --git a/resources/ansible_roles/ceph-disk-info/tasks/main.yml b/resources/ansible_roles/ceph-disk-info/tasks/main.yml
new file mode 100644
index 00000000..3186e3dd
--- /dev/null
+++ b/resources/ansible_roles/ceph-disk-info/tasks/main.yml
@@ -0,0 +1,40 @@
+##############################################################################
+# 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
+ shell: 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
+ 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
+ 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