This file contains hidden or 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 python3 | |
| """Show allocated static ips on mr-provisioner. | |
| Usage of this script: | |
| {0} provisioner-url token""" | |
| from urllib.parse import urljoin | |
| import requests | |
| import sys |
This file contains hidden or 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
| #!/bin/bash | |
| # ./set-reldata.sh percona-cluster/0 cluster foo=bar bar=foo | |
| set -ex | |
| for id in $(juju run --unit $1 "relation-ids $2"); do | |
| for unit in $(juju run --unit $1 "relation-list $id"); do | |
| juju run --unit $unit "relation-set -r $id ${@:3}" | |
| done | |
| done |
This file contains hidden or 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
| #!/bin/bash | |
| set -e | |
| trace_dir=${2:-trace} | |
| if [ ! -e ${trace_dir} ]; then | |
| mkdir ${trace_dir} | |
| fi |
This file contains hidden or 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
| #!/bin/bash | |
| # ./strace-hook.sh update-status | |
| # this command straces all the processes and subprocesses spawned | |
| # by a particular juju hook when is run. | |
| set -e | |
| hook=${1:-update-status} | |
| regex=".*${hook}.*" | |
| trace_dir=${2:-trace} |
This file contains hidden or 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
| SELECT | |
| sip.ip, | |
| CASE | |
| WHEN sip.alloc_type = 0 THEN 'AUTO' | |
| WHEN sip.alloc_type = 1 THEN 'STICKY' | |
| WHEN sip.alloc_type = 4 THEN 'USER_RESERVED' | |
| WHEN sip.alloc_type = 5 THEN 'DHCP' | |
| WHEN sip.alloc_type = 6 THEN 'DISCOVERED' | |
| ELSE CAST(sip.alloc_type as CHAR) | |
| END "alloc_type", |
This file contains hidden or 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
| size=$(stat -Lc%s centos.iso) | |
| virsh vol-create-as default centos $size --format raw | |
| virsh vol-upload --pool default centos centos.iso |
This file contains hidden or 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
| Some notes from engineering. | |
| 1) Identify the partition | |
| Mnesia('rabbit@juju-machine-30-lxd-11'): ** ERROR ** mnesia_event got {inconsistent_database, running_partitioned_network, 'rabbit@juju-machine-29-lxd-9'} | |
| $ sudo rabbitmqctl cluster_status | |
| 2) Pick the most reliable node as the master. |
This file contains hidden or 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
| function charmislatest() { | |
| if [ ! ${#@} -ge 2 ]; then | |
| echo -e "Please provide a charm name and a branch" && return; | |
| fi | |
| q=$(curl -s https://api.github.com/repos/openstack/charm-$1/commits/stable/$2 | python -c "import sys, json; q=json.load(sys.stdin); print q['sha']") | |
| head=$(curl -s https://api.jujucharms.com/charmstore/v5/$1/meta/extra-info | python -c "import sys, json; q=json.load(sys.stdin)['vcs-revisions'][-1]; print q['commit'];") | |
| if [ "$head" == "$q" ]; then | |
| echo "OK - $1 (Charmstore: $head == Github($2): $q)" | |
| else | |
| echo "Not OK - Charm is not latest: $q != $head" |
This file contains hidden or 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
| /var/log/juju/*.log { | |
| daily | |
| minsize 5M | |
| maxsize 50M | |
| copytruncate | |
| rotate 7 | |
| missingok | |
| compress | |
| delaycompress | |
| } |