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 / oslo-messaging.yml
Created December 13, 2018 17:02
qdrouterd suggested adjustments to inventory/group_vars/all/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 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 / type-forking.log
Created October 23, 2018 15:14
Fun with SystemD service statuses
# With the unit file having 'Type=forking'
root@aio1-glance-container-c7e2fe9a:~# systemctl daemon-reload; systemctl restart glance-api; echo $?
Job for glance-api.service failed because the control process exited with error code. See "systemctl status glance-api.service" and "journalctl -xe" for details.
1
Oct 23 15:11:31 aio1-glance-container-c7e2fe9a uwsgi[4559]: /openstack/venvs/glance-19.0.0.0b1/bin/uwsgi: error while loading shared libraries: libxml2.so.2: cannot open shared object file: No such file or directory
Oct 23 15:11:31 aio1-glance-container-c7e2fe9a systemd[1]: glance-api.service: Control process exited, code=exited status=127
Oct 23 15:11:31 aio1-glance-container-c7e2fe9a systemd[1]: Failed to start glance-api service.
-- Subject: Unit glance-api.service has failed
-- Defined-By: systemd
@odyssey4me
odyssey4me / galera-recover.yml
Created August 30, 2018 13:16
Galera cluster recovery using grvstate.dat
# ref: http://galeracluster.com/documentation-webpages/pcrecovery.html
- hosts: infra_hosts
tasks:
- shell: |
galera_container_name=$(ls -1 /openstack | grep galera)
echo "galera_container_name=${galera_container_name}"
gvwstate_path="/openstack/${galera_container_name}/gvwstate.dat"
if [[ -e ${gvwstate_path} ]]; then
echo "gvwstate_path=${gvwstate_path}"
echo "gvwstate=yes"
@odyssey4me
odyssey4me / transcript.log
Created July 26, 2018 16:06
Obscure openstack client error when an endpoint is setup incorrectly
(ansible-runtime) root@clienterror1:/opt/openstack-ansible/playbooks# openstack --os-cloud default endpoint list --service placement
+----------------------------------+-----------+--------------+--------------+---------+-----------+------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+------------------------------+
| 0c56bcd813f4468aa17780a7e7e5e280 | RegionOne | placement | placement | True | admin | http://172.29.236.100:8780 |
| 23f18ab141cd4f319725598309735b63 | RegionOne | placement | placement | True | public | https://104.239.231.253:8780 |
| b9fe7ee5e11a443d97abd9390fb28917 | RegionOne | placement | placement | True | internal | http://172.29.236.100:8780 |
+----------------------------------+-----------+--------------+--------------+---------+-----------
@odyssey4me
odyssey4me / repo-modify.yml
Created July 19, 2018 17:16
Patching a role via ansible
---
- hosts: localhost
connection: local
gather_facts: no
vars:
role_prefix: "aodh"
path_prefix: "{{ lookup('env', 'HOME') }}/code/openstack/openstack-ansible-os_{{ role_prefix }}"
defaults_path: "{{ path_prefix }}/defaults/main.yml"
tasks_main_path: "{{ path_prefix }}/tasks/main.yml"
tasks:
@odyssey4me
odyssey4me / .ansible.cfg
Last active July 10, 2018 07:38
Ansible 2.3 callback to record events in InfluxDB
# place in ~/.ansible.cfg
[defaults]
callback_whitelist = influxdb_events
retry_files_enabled = False
@odyssey4me
odyssey4me / osx_install.sh
Created June 25, 2018 22:18 — forked from kyleparisi/osx_install.sh
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
# Update: there is a way now, just haven't updated yet
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install mas
read -p "Press any key to continue... " -n1 -s
echo
mas install 1176895641 # Spark
@odyssey4me
odyssey4me / osa-build.sh
Last active June 15, 2018 15:19
MNAIO snapshots
apt-get update && \
apt-get purge -y nano && \
apt-get install -y git vim tmux fail2ban
echo 'set-option -g history-limit 9999' > ~/.tmux.conf
tmux new -s odyssey4me
cd /opt
git clone https://github.com/openstack/openstack-ansible-ops.git
cd openstack-ansible-ops/multi-node-aio
@odyssey4me
odyssey4me / chip-flash.sh
Created June 2, 2018 11:58 — forked from foxbunny/chip-flash.sh
Script to flash CHIP
#!/bin/bash
#
# This script programs the CHIP's NAND flash using sunxi-tools' `fel` utiltiy,
# and U-Boot itself. The following tools must be present on the system:
#
# - dd (coreutils)
# - lsusb (usbutils)
# - fel (sunxi-tools)
# - mkimage (android-tools)
#