Skip to content

Instantly share code, notes, and snippets.

View noonedeadpunk's full-sized avatar

Dmitriy Rabotyagov noonedeadpunk

View GitHub Profile
@noonedeadpunk
noonedeadpunk / gist:9a260f23ec78676576f4b19d79a4b679
Created December 13, 2019 16:15
Check OSA local roles changes
ROLES_DIR="/etc/ansible/roles/"; pushd $ROLES_DIR; ROLES=`ls -1`; popd; for role in $ROLES; do pushd $ROLES_DIR/$role; git diff; popd; done
@noonedeadpunk
noonedeadpunk / compare_conf.py
Last active December 12, 2019 15:06
Compare config files with configparser
#!/usr/bin/env python
import configparser
import itertools
import sys
from pprint import pprint
def compare_confs(src, dst):
src_conf = configparser.RawConfigParser()
@noonedeadpunk
noonedeadpunk / gist:d01ba61fa2b914b4963e916caed440aa
Created November 13, 2019 17:08
Get ceph filestore osds in csv: osdid,node,data path,journal path
for osd in `ceph osd tree | grep osd | awk '{ print $4 }' | cut -d '.' -f 2`; do ceph osd metadata $osd -f json | python -c "exec(\"import json\nimport sys\ndata = json.loads([ line for line in sys.stdin if line.strip()][0])\nif data['osd_objectstore'] == 'filestore':\n print(','.join([str(data['id']), data['hostname'], data['backend_filestore_partition_path'], data['backend_filestore_journal_partition_path'] if 'backend_filestore_journal_partition_path' in data else '']))\")"; done
@noonedeadpunk
noonedeadpunk / gist:c606cfc33ec7c76750b6c25d0feb8796
Created November 13, 2019 16:47
Fix ceph Legacy BlueStore stats
for osd in `systemctl | grep ceph-osd@ | cut -d "@" -f 2 | cut -d "." -f 1`; do systemctl stop ceph-osd@$osd; sleep 5; ceph-bluestore-tool repair --path /var/lib/ceph/osd/ceph-$osd; sleep 2; systemctl start ceph-osd@$osd; sleep 10; done