Skip to content

Instantly share code, notes, and snippets.

View codatory's full-sized avatar

Alex Conner codatory

View GitHub Profile
- name: Kubernetes LB Config
hosts: control
gather_facts: no
become: true
order: shuffle
tasks:
- name: Enable nonlocal bind
sysctl:
name: net.ipv4.ip_nonlocal_bind
value: 1
apiVersion: k0sctl.k0sproject.io/v1beta1
kind: Cluster
metadata:
name: k0s-cluster
spec:
hosts:
- ssh:
address: 10.8.0.11
user: codatory
port: 22
@codatory
codatory / hosts.yml
Last active November 21, 2022 15:57
Kubernetes host patching
all:
children:
control:
hosts:
10.8.0.11:
node_name: k-c-1
10.8.0.12:
node_name: k-c-2
10.8.0.13:
node_name: k-c-3
alertmanager:
enabled: false
grafana:
defaultDasboardsTimezone: "America/Indiana/Indianapolis"
persistence:
enabled: true
service:
type: "LoadBalancer"
initChownData:
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: l2-pool
namespace: metallb-system
spec:
addresses:
- 10.8.0.100-10.8.0.250
---
apiVersion: metallb.io/v1beta1
@codatory
codatory / firmware-update.yml
Created November 19, 2022 01:54
Kubernetes Host OS Bootstrap Playbook
- name: Applying OS Configuration Baseline
hosts: all
gather_facts: no
become: true
vars:
ansible_ssh_pipelining: true
tasks:
- name: Install fwupd
apt:
name: fwupd
@codatory
codatory / check_update.sh
Created February 27, 2012 20:16
CentOS / Fedora Weekly update checking script
#!/bin/bash
UPDATES=`yum check-update -q | awk '{print $1}'`
COUNT=`printf "%s\n" "$UPDATES" | grep -v "^$" | wc -l`
YUM=`printf "%s\n" "$UPDATES" | grep -v "^$" | grep yum`
echo '--------------------------------------------------------------------------------'
echo " Weekly Update Notification for `hostname`"
echo " -> $COUNT update(s) available"
if [ -n "$YUM" ]; then
echo ' -> IMPORTANT: A Yum update is available. Perform this separately and first.'
fi
@codatory
codatory / distcc-ccache-setup.sh
Created December 24, 2013 17:52
Ubuntu distcc & ccache setup script
#!/bin/bash
apt-get install -y distcc distcc-pump ccache
sed -ie 's/STARTDISTCC="false"/STARTDISTCC="true"/' /etc/default/distcc
sed -ie 's/ALLOWEDNETS="127.0.0.1"/ALLOWEDNETS="192.168.0.0\/16 172.16.0.0\/12 10.0.0.0\/8"/' /etc/default/distcc
sed -ie 's/LISTENER="127.0.0.1"/LISTENER="0.0.0.0"/' /etc/default/distcc
sed -ie "s/JOBS=\"\"/JOBS=\"`grep processor /proc/cpuinfo | wc -l`\"/" /etc/default/distcc
sed -ie 's/ZEROCONF="false"/ZEROCONF="true"/' /etc/default/distcc
version: "3"
services:
server:
image: openspeedtest/latest
container_name: openspeedtest
restart: always
ports:
- "80:8080"
@codatory
codatory / Gemfile
Created October 22, 2012 20:28
AWS Status Checker
source :rubygems
gem 'libusb'
gem 'nokogiri'