Skip to content

Instantly share code, notes, and snippets.

View logan2211's full-sized avatar

Logan V logan2211

View GitHub Profile
@logan2211
logan2211 / Dockerfile
Last active July 19, 2017 15:30
Dockerfile to download and build a BIOS update CD
FROM logan2211/docker-ci:ubuntu-xenial
# BIOS zip file to download
# ID 4058 is the 6218G-T41X 1.0b BIOS
ENV BIOS_URL "http://www.supermicro.com/support/resources/getfile.aspx?ID=4058"
ENV ISO_OUTPUT_DIR "/build"
ENV BUILD_SCRIPT_URL "https://gist.githubusercontent.com/Logan2211/0ebd320d0a5d37e71f88a9ef56a01719/raw/buildiso.sh"
RUN sudo apt-get update && \
@logan2211
logan2211 / inventory
Created July 14, 2017 15:17
Zabbix server join
[zabbix_server]
test-1-zbx1 container_host_ip="{{ ['172.19.0.15', '172.19.0.20', '172.19.0.21'] }}"
test-1-zbx2 container_host_ip="{{ ['172.19.0.16'] }}"
test-1-zbx3 container_host_ip="{{ ['172.19.0.17'] }}"
@logan2211
logan2211 / user_packages.yml
Created June 30, 2017 13:05
user_packages.yml
#reduced set of apt packages and kernel modules for LSN hosts
openstack_host_kernel_modules:
- br_netfilter
- 8021q
- dm_snapshot
- ip6table_filter
- ip6_tables
- ip_tables
- ipt_MASQUERADE
- ipt_REJECT
root@infra1:~# openstack --os-cloud default network agent list
+--------------------------------------+-------------------------------+---------+-------------------+-------+-------+--------------+
| ID | Agent Type | Host | Availability Zone | Alive | State | Binary |
+--------------------------------------+-------------------------------+---------+-------------------+-------+-------+--------------+
| 71c00627-6b8a-4072-8e00-7fedce480f4f | Calico per-host agent (felix) | agents1 | None | True | UP | calico-felix |
| c37ba20d-cdbf-4333-ad49-6faf9a7f1e50 | Calico per-host agent (felix) | agents2 | None | True | UP | calico-felix |
+--------------------------------------+-------------------------------+---------+-------------------+-------+-------+--------------+
root@infra1:~# openstack --os-cloud default network agent list --agent-type 'Calico per-host agent (felix)'
usage: openstack network agent list [-h] [-f {csv
@logan2211
logan2211 / ferm-install.yml
Created June 29, 2017 21:07
example osa firewall using debops.ferm role
---
- name: Deploy iptables ferm to host
hosts: all
max_fail_percentage: 20
serial: 10
user: root
pre_tasks:
- name: Compile a list of firewall rules
set_fact:
@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"
]
}
@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
#
---
# 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 / 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
@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