Skip to content

Instantly share code, notes, and snippets.

View logan2211's full-sized avatar

Logan V logan2211

View GitHub Profile
@logan2211
logan2211 / memory-resource-check.sh
Created November 11, 2021 15:55
Host memory over-commit (placement service)
#!/bin/bash
function get_resource_usage {
local UUID="$1"
local IFS=$'\n'
declare -Ag RESOURCE_USAGE
for i in $(openstack resource provider usage show "$UUID" -f value); do
CLASS=$(echo "$i" | awk '{ print $1 }')
USAGE=$(echo "$i" | awk '{ print $2 }')
RESOURCE_USAGE[${CLASS}]="${USAGE}"
- name: Backup MariaDB
hosts: "{{ mariadb_group }}[-1]"
pre_tasks:
- name: Install parallel bzip2
package:
name: pbzip2
- name: Copy the backup SSH key
copy:
src: ssh/production/db_backup_id_rsa
dest: /root/db_backup_id_rsa
@logan2211
logan2211 / calico-asn.yaml
Created March 6, 2020 16:19
Example demonstrating calico-node-baremetal usage with MetalLB
---
apiVersion: crd.projectcalico.org/v1
kind: BGPConfiguration
metadata:
name: default
spec:
asNumber: 65001
@logan2211
logan2211 / DIB 2.17 build
Created November 8, 2018 23:29
DIB 2.18 build failures
2018-11-08 23:01:34.451 | diskimage-builder version 2.17.0
2018-11-08 23:01:34.453 | Building elements: base ubuntu-minimal vm lsn-config block-device-mbr
2018-11-08 23:01:34.538 | DEBUG diskimage_builder.element_dependencies [-] ELEMENTS_PATH is: /root/.dib/local/lib/python2.7/site-packages/diskimage_builder/elements:/home/zuul-worker/src/sf.lstn.net/provisioning-metal/playbooks/../dib_elements _find_all_elements /root/.dib/local/lib/python2.7/site-packages/diskimage_builder/element_dependencies.py:208
2018-11-08 23:01:34.546 | DEBUG diskimage_builder.element_dependencies [-] New element : cloud-init-disable-resizefs p:<> d:<> __init__ /root/.dib/local/lib/python2.7/site-packages/diskimage_builder/element_dependencies.py:106
2018-11-08 23:01:34.546 | DEBUG diskimage_builder.element_dependencies [-] New element : dracut-ramdisk p:<> d:<source-repositories,ramdisk-base,pkg-map,deploy-targetcli> __init__ /root/.dib/local/lib/python2.7/site-packages/diskimage_builder/element_dependencies.py:106
2018-11-08 23:01:
@logan2211
logan2211 / tox.ini
Last active July 19, 2018 01:55
Ansible role testing tox.ini
[tox]
minversion = 2.0
skipsdist = True
envlist = linters,functional_2.3,functional_2.4,functional_stable
[testenv]
usedevelop = True
deps =
-r{toxinidir}/test-requirements.txt
@logan2211
logan2211 / limestone-job-failures.json
Last active October 11, 2018 20:16
limestone logstash json
{
"title": "Limestone Job Failures",
"services": {
"query": {
"list": {
"0": {
"query": "node_provider:limestone-regionone AND message:\"TASK [configure-unbound : Set IPv4 nameservers]\"",
"alias": "",
"color": "#7EB26D",
"id": 0,
@logan2211
logan2211 / user_variables.yml
Created March 19, 2018 22:14
multi-region OSA POC
service_region: regionTwo
master_region_keystone_address: "10.53.3.2"
keystone_service_region: regionOne
keystone_service_adminuri: "{{ keystone_service_adminuri_proto }}://{{ master_region_keystone_address }}:{{ keystone_admin_port }}"
keystone_service_internaluri: "{{ keystone_service_internaluri_proto }}://{{ master_region_keystone_address }}:{{ keystone_service_port }}"
# Make sure your keystone_auth_admin_password in user_secrets for the second region matches the password from regionOne
# These settings avoid username collisions when using the same keystone
# deployment across multiple regions.
---
# Copyright 2016, Logan Vig <[email protected]>
#
# 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
@logan2211
logan2211 / brokenoutput
Last active January 25, 2018 21:16
test playbook
PLAY [localhost] ********************************************************************************************************************************************************************
TASK [Gathering Facts] **************************************************************************************************************************************************************
ok: [localhost]
TASK [debug] ************************************************************************************************************************************************************************
ok: [localhost] => {
"msg": " false "
}
@logan2211
logan2211 / jenkins-job.sh
Created October 13, 2017 14:15
ceph-ansible role breakout update job
#!/bin/bash
set -x -e
function abort_filter {
git checkout master
git branch -D $1
}
sudo apt-get update && sudo apt-get install -y openssh-client git
mkdir -m 0700 ~/.ssh || true