Skip to content

Instantly share code, notes, and snippets.

View platu's full-sized avatar

Philippe Latu platu

View GitHub Profile
@platu
platu / seafile-on-lxd.md
Last active September 29, 2021 15:40
Seafile instance on LXD

Seafile + sqlite instance on LXD lab

This lab assumes that we have a running LXD setup based on this gist : UNprivileged lxd containers on top of Open vSwitch

Let's start with a container named seafile.

$ lxc ls
+---------+---------+-------------------+-----------------------------------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
@platu
platu / ovs+lxd-shared-vlans.md
Last active December 5, 2023 12:58
LXD containers networked on VLANs shared with the (ancient) physical world

LXD containers networked on VLANs shared with the (ancient) physical world

Topology

Starting from a Debian testing base install on host system ...


Let's start with networking

Install OvS on host

Start UNprivileged lxd containers on top of Open vSwitch in a few steps

C-3PO has to be fixed

Starting from a Debian bullseye base install on host system with old naming interface scheme ...


Consistent vs Oldfashioned network interface naming

Nowadays, network interface names follow the consistent naming rule. In

@platu
platu / lab14+ansible+iosxe.md
Last active February 19, 2024 15:37
DevNet Lab 14 – Use Ansible to Back Up and Configure a Router
tags
m1, devnet, cisco, linux, lab14

DevNet Lab 14 -- Use Ansible to Back Up and Configure a Router

[toc]


Background / Scenario

@platu
platu / lab15+ansible+incus.md
Last active February 20, 2024 10:03
Using Ansible to automate the installation of Web servers on Incus system containers
tags
m1, Devnet, incus, linux, lab15

DevNet Lab 15 -- Using Ansible to automate the installation of Web servers on Incus system containers

[toc]


Background / Scenario

@platu
platu / resize.sh
Last active February 28, 2024 07:44
IaC Lab01 vm image file resize script
#!/bin/bash
# This script resizes $1 VM disk image adding $2 GB to the original size
vm="$1"
shift
size="$1"
if [[ -z ${vm} ]] || [[ -z ${size} ]]; then
echo "Usage: $0 <vm> <size>"
@platu
platu / customize.sh
Created February 28, 2024 15:04
IaC Lab01 customize a VM image for the lab environment with management VRF
#!/bin/bash
# This script customizes a VM image for the lab environment
VM="$1"
shift
USER="$1"
shift
SECRET="$1"
shift
@platu
platu / prepare.yml
Last active March 19, 2024 10:22
IaC Lab01 Ansible playbook for virtualization env and switch port configuration
---
- name: PREPARE LAB ENVIRONMENT
hosts: hypervisors
tasks:
- name: ENSURE SYMLINK TO MASTERS DIRECTORY EXISTS
ansible.builtin.file:
src: /var/cache/kvm/masters
dest: "{{ ansible_env.HOME }}/masters"
state: link
@platu
platu / build_lab_inventory.py
Last active March 19, 2024 15:38
IaC Lab01 build dynamic inventory from VM launch traces
#!/usr/bin/env python3
import os
import re
import sys
import yaml
"""
VM launch trace file
@platu
platu / ansible.cfg
Last active March 19, 2024 15:42
IaC Lab01 repository Ansible configuration file
# config file for Lab 01: Build a new Debian GNU/Linux VM
[defaults]
# Use inventory/ folder files as source
inventory=inventory/
host_key_checking = False # Don't worry about RSA Fingerprints
retry_files_enabled = False # Do not create them
deprecation_warnings = False # Do not show warnings
interpreter_python = /usr/bin/python3
[inventory]
enable_plugins = auto, host_list, yaml, ini, toml, script