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 | |
# I use to work on different tasks and I like to know quickly if something is finished. | |
# With this script, I can shoot a long command (e.g: an OpenStack deployment) and focus | |
# on something else. | |
$* | |
if [ $? -eq 0 ]; then | |
status="SUCCESS" | |
icon=dialog-information | |
else | |
status="FAILURE" |
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 | |
for i in $(ls /sys/class/net/); do | |
echo -n "${i}: " | |
firewall-cmd --get-zone-of-interface=${i} | |
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
dcictl --format json job-list --where remoteci_id:4f8faddd-102b-400b-b295-e648501d16f8 --limit 50|jq '.jobs[]|select(.jobdefinition.name|contains("OSP 10"))| .id') |
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
set -eux | |
function cleanup() { | |
openstack server list -f value -c ID|xargs -r -n1 openstack server delete --wait | |
openstack flavor show rhcert && openstack flavor delete rhcert | |
openstack baremetal list -f value -c UUID|xargs -r -n1 openstack baremetal delete | |
} | |
cleanup | |
openstack flavor create --ram 1024 --disk 20 --vcpus 1 rhcert |
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
# To list the capability of a pool ID: | |
curl -v -u foo:bar -k https://subscription.rhn.redhat.com/subscription/pools/8a85f98260c27fc50160c323263339ff|jq . | |
# See: https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/red_hat_subscription_management_integration_guide/examples2 |
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
# find a pool id with "Red Hat Certificate System" | |
subscription-manager attach --pool THE_ID | |
subscription-manager repos '--disable=*' --enable=rhel-7-server-rpms --enable=rhel-7-server-optional-rpms --enable=rhel-7-server-extras-rpms --enable=rhel-7-server-openstack-10-rpms --enable=rhel-7-server-cert-rpms | |
yum install -y redhat-certification | |
rhcertd start | |
systemctl restart httpd |
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
for i in $(openstack server list --format json|jq -r '.[].Networks'); do | |
eval $i | |
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no heat-admin@${ctlplane} sudo sudo crudini --set /etc/cinder/cinder.conf DEFAULT debug True | |
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
+cat ~/instackenv.json|jq '.nodes| {nodes: map(del (.service_tag)|del (.model)|del (.provisioning_mac))}' > /tmp/clean_instackenv.json |
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 | |
if [ -z $1 ]; then | |
echo "Usag: $0 tag_name" | |
exit 1 | |
fi | |
tag_name=$1 | |
tag_id=$(dcictl --format json topic-list --where name:${tag_name}|jq -r '.topics[0].id') | |
component_id=$(dcictl --format json component-list --topic-id ${tag_id} --limit 1|jq -r .components[0].id) | |
component_name=$(dcictl --format json component-list --topic-id ${tag_id} --limit 1|jq -r .components[0].name) |
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/env python | |
import argparse | |
import yaml | |
parser = argparse.ArgumentParser() | |
parser.add_argument('old_template', type=open, help='The old NIC template') | |
ns = parser.parse_args() | |
data = yaml.load(ns.old_template.read()) | |
osnetcfgimpt = data['resources']['OsNetConfigImpl'] |