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
#!/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
#!/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 | |
# 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
# 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
# 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
# rabbit | |
pcs -f /var/lib/pacemaker/cib/puppet-cib-backup20190312-9-wbbpc3 property set --node controller-1 rabbitmq-role=true | |
pcs -f /var/lib/pacemaker/cib/puppet-cib-backup20190312-9-102c8c3 resource bundle create rabbitmq-bundle container docker image=192.168.24.1:8787/rhosp13/openstack-rabbitmq:pcmklatest replicas=3 options="--user=root --log-driver=journald -e KOLLA_CONFIG_STRATEGY=COPY_ALW | |
AYS" run-command="/bin/bash /usr/local/bin/kolla_start" network=host storage-map id=rabbitmq-cfg-files source-dir=/var/lib/kolla/config_files/rabbitmq.json target-dir=/var/lib/kolla/config_files/config.json options=ro storage-map id=rabbitmq-cfg-data source-dir=/var/lib/ | |
config-data/puppet-generated/rabbitmq/ target-dir=/var/lib/kolla/config_files/src options=ro storage-map id=rabbitmq-hosts source-dir=/etc/hosts target-dir=/etc/hosts options=ro storage-map id=rabbitmq-localtime source-dir=/etc/localtime target-dir=/etc/localtime options | |
=ro storage-map id=rabbitmq-lib source-dir=/var/lib/rabbitmq target-dir=/var/lib/r |
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
from keystoneauth1 import session | |
from keystoneauth1.identity import v3 | |
from swiftclient.client import Connection | |
from tripleo_common.utils import swift as swiftutils | |
_authurl = 'http://192.168.24.1:5000/v3/' | |
_auth_version = '3' | |
_user = 'admin' | |
# (sudo hiera -c /etc/puppet/hiera.yaml keystone::admin_password) | |
_key = '6aMpWobr5ySX47vwJefUgMGAA' |
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 -eu | |
# This only works when ran from the undercloud on an infrared setup | |
SSH_OPT="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" | |
node0="controller-0" | |
node1="controller-1" | |
# Let's kill controller-0 and controller-1 leaving only controller-2 up |
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 OS_PROJECT_DOMAIN_NAME='Default' | |
export OS_USER_DOMAIN_NAME='Default' | |
export OS_PROJECT_NAME='admin' | |
export OS_USERNAME='admin' | |
export OS_AUTH_URL=http://192.168.24.2:5000/ | |
export OS_AUTH_TYPE='password' | |
export OS_IDENTITY_API_VERSION='3' | |
export OS_PASSWORD=$(sudo hiera -c /etc/puppet/hiera.yaml keystone::admin_password) |