summaryrefslogtreecommitdiffstats
path: root/resources/ansible_roles/ceph-cache-info/tasks/main.yml
blob: 7e29a325b1b2acf45eb0497b514d595dcab70333 (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
##############################################################################
# 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