This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
description = "A nixos cloudinit base image without nixos-infect"; | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs"; | |
}; | |
outputs = { self, nixpkgs }: | |
let | |
system = "x86_64-linux"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias os='openstack --os-cloud rxt-mvp ' | |
os network create osh1 | |
os subnet create \ | |
osh1-subnet \ | |
--network osh1 \ | |
--subnet-range 172.31.0.0/28 \ | |
--dns-nameserver 8.8.8.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ara-task-uniq-hosts () { | |
# Scans across all tasks within 1 million records and returns all of the unique hosts where the task | |
# meets a certain state. Default state is "ok" | |
# When looking for the "changed" state the special CLI modifier is used. | |
TASK_NAME=$1 | |
TASK_STATE=${2:-ok} | |
if [ ${TASK_STATE} == "changed" ]; then | |
TASK_MODIFY="--changed" | |
else | |
TASK_MODIFY="--status ${TASK_STATE}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fig-up () { | |
function get_latest_release() { | |
curl $(curl --silent "https://api.github.com/repos/ovrclk/cosmos-omnibus/releases/latest" | jq ".url" -r) | jq -r .tag_name | |
} | |
function get_rpc_endpoint() { | |
curl --silent "https://cdn.jsdelivr.net/gh/cosmos/chain-registry@master/$1/chain.json" | jq ".apis.rpc[0].address" -r | |
} | |
if ! command -v jq &> /dev/null; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This playbook is used to upgrade teleport in place, it will deploy the apt repo using facts. | |
# | |
# Invocation, | |
# $ ansible-playbook -i ~/projects/teleport-inventory.py ~/projects/teleport-playbook.yml -e ansible_user=debian --limit '!teleport-server' | |
# | |
# NOTE: This playbook book exectuion is using dynamic inventory and a limit which is ensuring that the playbook is not executed against | |
# the teleport server. The playbook can be used on the teleport server, it just has to be done in isolation; a restart of the server | |
# will impact client connectivity. | |
--- | |
- name: Teleport updates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
import json | |
import re | |
import sys | |
GROUPS = dict() | |
HOSTS = dict() | |
PROTOS = dict() | |
R_WORDS = re.compile(r"\w+") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > /etc/modprobe.d/blacklist-nouveau.conf <<EOF | |
blacklist nouveau | |
options nouveau modeset=0 | |
EOF | |
apt update | |
apt install -y wget linux-headers-$(uname -r) build-essential libglvnd-dev pkg-config dkms | |
DOWNLOAD_URL="https://us.download.nvidia.com/XFree86/Linux-x86_64/515.76/NVIDIA-Linux-x86_64-515.76.run" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Required config | |
# $ export ANSIBLE_SCP_IF_SSH=False | |
# $ export ANSIBLE_SSH_ARGS="-F /home/USERNAME/.ssh/teleport.cfg" | |
# $ export ANSIBLE_INVENTORY_ENABLED=yaml | |
# $ export ANSIBLE_HOST_KEY_CHECKING=false | |
--- | |
- hosts: all | |
gather_facts: true | |
become: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Teleport Inventory Documentation. | |
Very simple inventory script which will use teleport as a dynamic inventory source. | |
The script assumes you've logged in and have access to the teleport service. | |
The script will read machines and return JSON information from teleport. Once the | |
return information is sourced, it will format the inventory using the node name | |
as the target host and the labels as hostvars and groups. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/openrc | |
pushd /mnt/storage/media/cloud-images | |
for NAME in $(ls -1 /mnt/storage/media/cloud-images | egrep '\.(img|qcow2)'); do | |
openstack image create --disk-format qcow2 --container-format bare --public --file /mnt/images/${NAME} ${NAME}; \ | |
openstack image set --property hw_scsi_model=virtio-scsi \ | |
--property hw_disk_bus=scsi \ | |
--property hw_vif_multiqueue_enabled=true \ | |
--property hw_qemu_guest_agent=yes \ | |
--property hypervisor_type=kvm \ |