aboutsummaryrefslogtreecommitdiffstats
path: root/resources/ansible_roles/ceph-disk-info/tasks/main.yml
blob: 3186e3dd81ad1337beee7ed2ff4629ff58d576d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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