Skip to content

Instantly share code, notes, and snippets.

Avatar

Jesse Pretorius odyssey4me

View GitHub Profile
View rename-nics.yaml
---
# Final published location: https://access.redhat.com/solutions/4067471
- name: Rename network interfaces
hosts: all
become: true
vars:
src_prefix: "eth"
dst_prefix: "em"
osnet_conf: "/etc/os-net-config/config.json"
src_interfaces: "{{ ansible_interfaces | select('match', src_prefix ~ '.*') | sort | list }}"
@odyssey4me
odyssey4me / gist:3ce1b4f08bf8ceb34b93590c11d1f91a
Last active Jul 30, 2021
Mac OS X: working around brew failing to install a cask due to a protected file in /usr/local/lib/
View gist:3ce1b4f08bf8ceb34b93590c11d1f91a
If you see an error like this:
% brew install macfuse
==> Caveats
macfuse requires a kernel extension to work.
If the installation fails, retry after you enable it in:
System Preferences → Security & Privacy → General
For more information, refer to vendor documentation or this Apple Technical Note:
https://developer.apple.com/library/content/technotes/tn2459/_index.html
@odyssey4me
odyssey4me / 1-system_upgrade-batch_1.sh
Last active Mar 17, 2021
Examples of parallelism when running OSP 13->16.1 control plane upgrades
View 1-system_upgrade-batch_1.sh
#!/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 / yum.conf
Created Aug 6, 2020
Optimising yum repo access
View yum.conf
# 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 / virt-install-centos
Created Apr 23, 2020 — forked from jnaulty/virt-install-centos
Install CentOS cloud images on KVM using cloud-init
View virt-install-centos
#!/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 / lvm-loopback-1.yml
Last active Apr 20, 2020
LVM local loopback device setup (RedHat)
View lvm-loopback-1.yml
- 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 Mar 24, 2020
TripleO handy notes
View applying_patches.sh
# 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 / output.log
Created Dec 14, 2018
ansible update vs combine
View output.log
PLAY [localhost] ************************************************************************************************************************************************************
TASK [debug] ****************************************************************************************************************************************************************
ok: [localhost] => {
"msg": ""
}
TASK [debug] ****************************************************************************************************************************************************************
ok: [localhost] => {
"msg": {
@odyssey4me
odyssey4me / oslo-messaging.yml
Created Dec 13, 2018
qdrouterd suggested adjustments to inventory/group_vars/all/oslo-messaging.yml
View oslo-messaging.yml
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@odyssey4me
odyssey4me / inventory.ini
Last active Dec 14, 2018
Automated neutron agent migrations for P->Q
View inventory.ini
# 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