Skip to content

Instantly share code, notes, and snippets.

View odyssey4me's full-sized avatar

Jesse Pretorius odyssey4me

  • Red Hat
  • United Kingdom
View GitHub Profile
@odyssey4me
odyssey4me / 1-system_upgrade-batch_1.sh
Last active March 17, 2021 18:47
Examples of parallelism when running OSP 13->16.1 control plane upgrades
#!/bin/env bash
#
# Run overcloud Operating System upgrade on overcloud node ceph-0,controller-0,database-0,messaging-0,networker-0
#
set -euo pipefail
source /home/stack/stackrc
if [ ! -f .ceph_ran_ceph-0,controller-0,database-0,messaging-0,networker-0 ]; then
@odyssey4me
odyssey4me / 00-full-command-transcript.sh
Last active November 18, 2020 02:51
Ansible remote chroot experimentation
#!/bin/bash
# do this on localhost (deployment host)
# ensure that there's a local ssh private key
ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
# now make sure that the public key is in the second host's authorized_keys
# then do a test ssh connection to make sure it works, and to add the host
# to known hosts
@odyssey4me
odyssey4me / virt-install-centos
Created April 23, 2020 16:34 — forked from jnaulty/virt-install-centos
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
@odyssey4me
odyssey4me / yum.conf
Created August 6, 2020 16:37
Optimising yum repo access
# the default is 6h apparently
metadata_expire=24h
# the default is group:primary
mdpolicy=group:all
# this should be the default
retries=10
# no mention is made of what the default is
http_caching=all
@odyssey4me
odyssey4me / lvm-loopback-1.yml
Last active April 20, 2020 16:56
LVM local loopback device setup (RedHat)
- hosts: localhost
connection: local
gather_facts: yes
vars:
volume_path: "/var/lib/lvm-volume1"
volume_size: "100M"
volume_name: "loopback-volumes"
tasks:
- name: Ensure LVM dependencies are installed
package:
@odyssey4me
odyssey4me / applying_patches.sh
Last active March 24, 2020 12:53
TripleO handy notes
# Resetting back to the package state
rm -rf /usr/share/openstack-tripleo-heat-templates; yum reinstall -y openstack-tripleo-heat-templates
# Getting it from gerrit
GERRIT_ID="<num>"; \
FOLDER="openstack-tripleo-heat-templates"; \
curl -4 "https://review.opendev.org/changes/${GERRIT_ID}/revisions/current/patch?download" | \
base64 -d | \
sudo patch -d "/usr/share/${FOLDER}/" -p1
@odyssey4me
odyssey4me / 00-setup.sh
Last active November 2, 2019 03:04
Setup a basic nodepool host using a single VM and localhost
# prep host
apt update
apt purge nano
apt install git vim tmux fail2ban
# prep ssh key
key_path="${HOME}/.ssh"
key_file="${key_path}/id_rsa"
mkdir -p ${key_path}
chmod 700 ${key_path}
@odyssey4me
odyssey4me / ansible.cfg
Last active March 27, 2019 20:48
Ansible/OpenStack configuration
# In ~/.ansible.cfg
[defaults]
inventory = ~/.ansible/inventory
retry_files_enabled = False
#stdout_callback = yaml
bin_ansible_callbacks = True
[inventory]
enable_plugins = ini, openstack
cache_connection = /tmp/ansible_fact_cache
@odyssey4me
odyssey4me / inventory.ini
Last active December 14, 2018 17:26
Automated neutron agent migrations for P->Q
# 1. Place this file in /etc/openstack_deploy before running Queens playbooks.
# 2. Run the Pike-Queens upgrade.
# 3. Confirm that there are now agents on the network hosts.
# 4. Disable the agents in the network_agents container.
# 5. Ensure all rebalancing is done to make everything run on the host agents.
# 6. Use lxc-containers-destroy to remove all members of the neutron_agents_container group.
# 7. Use inventory-manage to remove all members of the neutron_agents_container group.
# 8. Remove this file from /etc/openstack_deploy.
# ref:
# - https://bugs.launchpad.net/openstack-ansible/+bug/1804770
@odyssey4me
odyssey4me / output.log
Created December 14, 2018 14:35
ansible update vs combine
PLAY [localhost] ************************************************************************************************************************************************************
TASK [debug] ****************************************************************************************************************************************************************
ok: [localhost] => {
"msg": ""
}
TASK [debug] ****************************************************************************************************************************************************************
ok: [localhost] => {
"msg": {