This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import configparser | |
import itertools | |
import sys | |
from pprint import pprint | |
def compare_confs(src, dst): | |
src_conf = configparser.RawConfigParser() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Classis FOR ### | |
vhost="/"; for queue in `rabbitmqctl list_queues name consumers -p $vhost --formatter csv`; do name=`echo $queue | cut -d "," -f 1 | tr -d '"'`; consumers=`echo $queue | cut -d "," -f 2 | tr -d '"'`; if [[ "$consumers" == "0" ]]; then rabbitmqctl delete_queue $name -p $vhost ; fi; done | |
### Faster XARGS ### | |
vhost="/"; rabbitmqctl list_queues name consumers -p $vhost --formatter csv | xargs -P 20 -I {} env vhost=$vhost bash -c 'name=$(echo {} | cut -d "," -f 1); consumers=$(echo {} | cut -d "," -f 2); if [[ "$consumers" != "0" ]]; then rabbitmqctl delete_queue $name -p $vhost ; fi' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Create users | |
hosts: all | |
vars: | |
group: mygroup | |
user: myuser | |
keys_path: ./ssh_keys | |
tasks: | |
- name: Create group | |
group: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Sync clock with chrony | |
hosts: all | |
tasks: | |
- name: disable ntp | |
service: | |
name: ntp | |
state: stopped | |
enabled: false | |
failed_when: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Install and configure ipa-client | |
hosts: "{{ hosts }}" | |
tasks: | |
- name: Install ipa-client package | |
package: | |
name: "{{ (ansible_os_family == 'Debian') | ternary('freeipa-client', 'ipa-client') }}" | |
state: installed | |
register: ipa_install | |
- name: Run configuration command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Reset password | |
hosts: "{{ host }}" | |
vars: | |
ipmi_password: "{{ lookup('password', '/tmp/' ~ inventory_hostname ~ '_ipmipassword chars=ascii_letters,digits length=16') }}" | |
system_password: "{{ lookup('password', '/tmp/' ~ inventory_hostname ~ '_rootpassword chars=ascii_letters,digits,-,_,! length=20') }}" | |
tasks: | |
- name: install ipmitool | |
package: | |
name: ipmitool | |
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/share/spice-html5/spice_auto.html: | |
<div id="login"> | |
<span class="logo">SPICE</span> | |
+ <div class="spice-send-ctrl-alt-del"> | |
+ <button type="button" onclick="sendCtrlAltDel()"> | |
+ Send Ctrl-Alt-Delete | |
+ </button> | |
+ </div> | |
</div> |
OlderNewer