Skip to content

Instantly share code, notes, and snippets.

View goneri's full-sized avatar
🇺🇦

Gonéri Le Bouder goneri

🇺🇦
View GitHub Profile
#!/bin/bash
#https://github.com/pre-commit/pre-commit/issues/360
unset _OLD_VIRTUAL_PATH
[ -d venv ] || virtualenv -p /usr/bin/python3 venv
[ -d dci-control-server ] || git clone https://github.com/redhat-cip/dci-control-server
[ -d dci-ui ] || git clone https://github.com/redhat-cip/dci-ui
. venv/bin/activate
pip install -e dci-control-server
@goneri
goneri / gist:b0eadfade46760469c4530d050368bb6
Created July 18, 2016 15:56
validate all the overcloud nodes are available
for i in $(nova list|awk '/ctlplane/ {print $12}'); do eval $i; echo -n "${ctlplane}: "; ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet heat-admin@${ctlplane} hostname || echo '**KO**'; done
@goneri
goneri / heat-last-error
Created July 21, 2016 14:17
Print last error message
jq -r .deploy_stderr $(ls -1 -St /var/lib/heat-config/deployed/*.notify.json|head -n1)
@goneri
goneri / heat-list-last-errors
Last active September 6, 2017 18:32
show last os-collect-config error
#!/bin/bash
set -eu
do_ssh="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet heat-admin@"
for i in $(nova list|awk '/ctlplane/ {print $12}'); do
eval $i
echo -n "${ctlplane} "
if [ -z $(${do_ssh}${ctlplane} hostname) ]; then
echo "Cannot reach host $ctlplane"
continue
else
LIBGUESTFS_BACKEND=direct virt-customize -v -x --add overcloud-full.qcow2 --run-command 'subscription-manager register --username="foo" --password="bar"' --run-command 'subscription-manager attach --auto' --run-command "subscription-manager repos '--disable=*' --enable=rhel-7-server-rpms" --update --run-command 'subscription-manager remove --all' --run-command 'subscription-manager unregister'
dcictl job-output (dcictl job-list --where 'remoteci_id:6653f35a-41a5-4e1d-9365-b79a530e86be' --limit 1|awk '/Juniper/ {print $2}')
ansible localhost -m find -a 'path=/home/goneri/tmp/mirror/DCI-current patterns="rhosp-director-images*.rpm" recurse=yes'
ironic node-list | awk '/power on/ {print $2}'|xargs -n1 -I '{}' ironic node-set-power-state '{}' off
[DEFAULT]
log_dir = /home/stack/bob/logs
log_file = tempest.log
[oslo_concurrency]
lock_path = /home/stack/bob/tempest_lock
[auth]
use_dynamic_credentials = true
admin_username = admin
dcictl --format=json job-list --where 'remoteci_id:6653f35a-41a5-4e1d-9365-b79a530e86be' --limit 1|jq -r .jobs[0].id|xargs dcictl job-output