Skip to content

Commit

Permalink
fix TMPFILE reference
Browse files Browse the repository at this point in the history
  • Loading branch information
ricolin committed Apr 2, 2024
1 parent 061961e commit f32bf24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions roles/osd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
- inventory_hostname == groups[ceph_osd_osds_group] | last

- name: Make sure `/var/lib/cron` directory exists
when: ceph_bluestore_frag_collect
ansible.builtin.file:
path: /var/lib/cron
state: directory
Expand Down
6 changes: 3 additions & 3 deletions roles/osd/templates/prom-bs-frag-score-collector.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

export TMPFILE=/tmp/bluestore_allocator_score_block.prom.$$
osd_path=$(find /var/lib/ceph/{{ ceph_mon_fsid }}/ -type d -name "osd.*"| head -n 1)
if [ -z $osd_path ]; then
if [ ! -z $osd_path ]; then
cephadm --image "{{ cephadm_image }}" shell --fsid "{{ ceph_mon_fsid }}" \
--config "$osd_path/config" \
-m /var/lib/cron/bs-frag-score.sh -- ./mnt/bs-frag-score.sh > TMPFILE
-m /var/lib/cron/bs-frag-score.sh -- ./mnt/bs-frag-score.sh > $TMPFILE
else
cephadm --image "{{ cephadm_image }}" shell --fsid "{{ ceph_mon_fsid }}" \
-m /var/lib/cron/bs-frag-score.sh -- ./mnt/bs-frag-score.sh > TMPFILE
-m /var/lib/cron/bs-frag-score.sh -- ./mnt/bs-frag-score.sh > $TMPFILE
fi

mv $TMPFILE /tmp/bluestore_allocator_score_block.prom

0 comments on commit f32bf24

Please sign in to comment.