Skip to content

Instantly share code, notes, and snippets.

View logan2211's full-sized avatar

Logan V logan2211

View GitHub Profile
haproxy_service_configs: "{{ haproxy_infra + haproxy_openstack_public + haproxy_openstack_internal }}"
haproxy_infra:
- service:
haproxy_service_name: galera
haproxy_backend_nodes: "{{ [groups['galera_all'][0]] | default([]) }}" # list expected
haproxy_backup_nodes: "{{ groups['galera_all'][1:] | default([]) }}"
haproxy_port: 3306
haproxy_balance_type: tcp
haproxy_timeout_client: 5000s
@logan2211
logan2211 / Aggregated by nodepool name
Created May 18, 2016 14:53
2016-05-18 OSA Gate Stats
ubuntu-trusty-rax-ord
repo_build | Create role based venv = 317.95
repo_build | Clone all upstream git repositories = 250.39
lxc_container_create | Create container = 177.81
repo_build | Create OpenStack-Ansible requirement wheels = 172.3
lxc_hosts | Prepare cached image = 168.84
os_tempest | Install requires pip packages = 127.11
repo_build | Run venv process script = 109.92
repo_build | Run clone process script = 108.92
lxc_hosts | Prepare cached image with packages = 80.29
logan@LoganLTop ~/temp/osa-gate-profile $ php branchprofile.php
Fetching results for 2016.05.21
Analyzing 154 samples
Fetching results for 2016.05.20
Analyzing 2118 samples
Fetching results for 2016.05.19
Analyzing 1349 samples
Fetching results for 2016.05.18
Analyzing 844 samples
Fetching results for 2016.05.17
- name: apt-mirror
scm: git
src: http://github.com/Logan2211/ansible-apt-mirror
version: master
#!/bin/sh -e
#this script requires a routing table named $IFACE (ie. bond0) exists in /etc/iproute2/rt_tables
#the $IFACE routing table is used to place the default route in for the source routing table
#ip route list table $IFACE will list the routing table for this interface
set_netinfo() {
IPADDR=$(ifconfig "$IFACE" | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
NETMASK=$(ifconfig "$IFACE" | grep 'inet addr:' | cut -d: -f4 | awk '{ print $1}')
OLDIFS=$IFS
@logan2211
logan2211 / group_vars-all.yml
Created December 21, 2016 01:29
Ceph OSD auto classification
ceph_layouts:
4HDD:
devices:
- /dev/sda
- /dev/sdb
- /dev/sdc
- /dev/sdd
'1SSD+4HDD':
journal_size: 10000
raw_multi_journal: true
@logan2211
logan2211 / manage_console_logs.sh
Last active April 6, 2017 16:23
Truncate large console.log in nova instances
#!/bin/bash
# Based on https://mcwhirter.com.au/craige/blog/2014/Managing_KVM_Console_Logs_for_Nova/ and
# https://bitbucket.org/craigemcw/scripts/src/f55ddcd5f23b867c7d64505d5c037c14658d7775/OpenStack/manage_console_logs.sh?at=master&fileviewer=file-view-default
#
# In certain circumstances, KVM console logs in OpenStack can grow rapidly and
# easily fill your compute node disks. Run this script at a desirable interval
# to ensure that the logs are kept to a reasonable length.
set -eux
---
# Copyright 2016, Logan Vig <logan2211@gmail.com>
#
# 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 / kvm-compute_hosts.yml
Last active June 15, 2017 17:53
Split compute_hosts groups
---
# Excerpted from /etc/openstack_deploy/group_vars/kvm-compute_hosts.yml
# Copyright 2016, Logan Vig <logan2211@gmail.com>
#
# 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
#
@logan2211
logan2211 / test.yml
Created June 22, 2017 20:33
Testing whitespace output of generated var pattern
$ ansible-playbook test.yml
PLAY [localhost] ***************************************************************
TASK [debug] *******************************************************************
ok: [localhost] => {
"msg": [
"test1",
"test2"
]
}