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
# stop active systemd | |
for i in $(systemctl list-units |grep -e 'tripleo.*active' -e 'tripleo.*timer'|awk '{ print $1}'); do | |
echo $i; | |
sudo systemctl stop $i; | |
done | |
sudo podman ps -q -a |xargs -n1 sudo podman rm -f | |
sudo podman images -q -a |xargs -n1 sudo podman rmi -f | |
sudo rm -rf /var/lib/mysql/* |
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
# To delete all hosts that are not freeipa and undercloud | |
# Go to freeipa-0 and open /tmp/freeipa-setup.env | |
# look for AdminPassword | |
kinit admin | |
# Type in AdminPassword | |
D='redhat.local' | |
for i in $(ipa host-find |grep 'Host name:' | awk '{ print $3 }' | grep -v -e freeipa-0 -e undercloud-0 -e "ctlplane.$D" -e "$D" -e "internalapi.$D" -e "storage.$D" -e "storagemgmt.$D"); do ipa host-del "$i"; 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
#!/bin/bash | |
set -e | |
# Before running this script it would be best to disable haproxy on the other nodes | |
# via: for i in controller-1 controller-2; do pcs resource ban haproxy-bundle $i; done | |
# To clear the bans: for i in controller-1 controller-2; do pcs resource clear haproxy-bundle $i; done | |
# Run this script as root on the single controller you want to stay active | |
CONF="/var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg" | |
HOST=$(hostname) | |
# Enable admin access to the haproxy stat socket |
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
#!/bin/bash | |
set -ex | |
mkdir sosreports || /bin/true | |
declare -A pids | |
nodes=$(openstack --os-cloud undercloud server list -f value -c Networks |cut -f2 -d\=) | |
for i in $nodes; do | |
echo "Collecting for $i" | |
ssh $i 'sudo sosreport --quiet --batch; sudo chmod 644 /var/tmp/sos*xz' & | |
pids["$i"]="$!" |
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
#!/bin/bash | |
set -e | |
cd /home/stack | |
source ./stackrc | |
if [ ! -f inv.yml ]; then | |
tripleo-ansible-inventory --static-yaml-inventory inv.yml | |
fi | |
cat > /tmp/sosreport.yml <<EOF |
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
rm /opt/puppetlabs/facter/cache/ -rf | |
rm -fr /var/lib/container-puppet/puppetlabs/ | |
mkdir /var/lib/container-puppet/puppetlabs/ | |
cat > /var/lib/container-puppet/puppetlabs/facter.conf <<EOF | |
facts : { | |
ttls: [ | |
{ "kernel" : 98 hour }, | |
{ "memory" : 98 hour }, | |
{ "networking" : 98 hour }, | |
{ "operating system" : 98 hour }, |
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
ospgrep() { | |
echo "$*" | |
grep -E "\s\b(E[rR]{2}:?|alert|Traceback|TRACE|crit|fatal|HANDLER|TASK|PLAY|Unexpected|FAIL|[Ff]ail|denied|non-zero|[Tt]ime[d\s]?out|UNCAUGHT|EXCEPTION|Unknown|[Aa]ssertion|inuse)" $* | |
} |
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
#!/bin/bash | |
set -x | |
source /etc/os-release | |
sudo systemctl stop tripleo_\* | |
sudo systemctl stop ceph\* | |
sudo pcs cluster destroy | |
if [ $VERSION_ID == "7" ]; then | |
sudo docker ps -a -q | xargs docker rm -f | |
else |
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
export SBDB=$(sudo ovs-vsctl get open . external_ids:ovn-remote | sed -e 's/\"//g') ; export NBDB=$(sudo ovs-vsctl get open . external_ids:ovn-remote | |
| sed -e 's/\"//g' | sed -e 's/6642/6641/g') ; alias ovn-sbctl='sudo podman exec ovn_controller ovn-sbctl --db=$SBDB' ; alias ovn-nbctl='sudo podman | |
exec ovn_controller ovn-nbctl --db=$NBDB' ; alias ovn-trace='sudo podman exec ovn_controller ovn-trace --db=$SBDB' | |
ovn-sbctl list chassis | |
ovs-vsctl get open . external_ids:ovn-bridge-mappings | |
ovn-nbctl --db="ssl:172.17.1.122:6641" -p /etc/pki/tls/private/ovn_controller.key -c /etc/pki/tls/certs/ovn_controller.crt -C /etc/ipa/ca.crt show |
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
--- | |
# We require the kubernetes collection. Install it first via: | |
# ansible-galaxy collection install community.kubernetes | |
# | |
# This expects four environment variables to be set: | |
# KUBECONFIG -> Pointing to the HUB | |
# REMOTEAPI -> API endpoint of the remote cluster | |
# REMOTECLUSTERNAME -> Name of the cluster you want to import | |
# REMOTETOKEN -> Token of the remote cluster | |
- name: Playbook to import a cluster |