summaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rw-r--r--resources/ansible_roles/ceph-cache-info/meta/main.yml14
-rw-r--r--resources/ansible_roles/ceph-cache-info/tasks/main.yml34
-rw-r--r--resources/ansible_roles/ceph-disk-info/meta/main.yml14
-rw-r--r--resources/ansible_roles/ceph-disk-info/tasks/main.yml40
4 files changed, 102 insertions, 0 deletions
diff --git a/resources/ansible_roles/ceph-cache-info/meta/main.yml b/resources/ansible_roles/ceph-cache-info/meta/main.yml
new file mode 100644
index 00000000..29b2992e
--- /dev/null
+++ b/resources/ansible_roles/ceph-cache-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-cache-info }
diff --git a/resources/ansible_roles/ceph-cache-info/tasks/main.yml b/resources/ansible_roles/ceph-cache-info/tasks/main.yml
new file mode 100644
index 00000000..7e29a325
--- /dev/null
+++ b/resources/ansible_roles/ceph-cache-info/tasks/main.yml
@@ -0,0 +1,34 @@
+##############################################################################
+# 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
+##############################################################################
+
+- fetch:
+ src: /etc/ceph/ceph.conf
+ dest: "{{ qtip_results }}/sysinfo-{{ inventory_hostname }}/"
+ flat: yes
+
+- name: collect ceph catch info from ceph.conf
+ set_fact: {"{{ item }}":"{{ lookup('ini', '{{ item }} section=client default='' file={{ qtip_results }}/sysinfo-{{ inventory_hostname }}/ceph.conf') }}"}
+ with_items:
+ - rbd_cache
+ - rbd_cache_max_dirty
+ - rdb_cache_size
+ delegate_to: localhost
+ ignore_errors: True
+ register: result
+
+- name: saving output to log
+ copy:
+ content: "{{ item }} {{ item.stdout }}"
+ dest: "{{ logfile }}"
+ when: result|succeeded
+ delegate_to: localhost
+ with_items:
+ - rbd_cache
+ - rbd_cache_max_dirty
+ - rdb_cache_size
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