No description
  • HCL 93.7%
  • Shell 4.2%
  • Python 2.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-29 09:05:48 -04:00
.claude/commands Add some bmad stuff for testing 2026-02-03 11:38:15 -05:00
.crush/commands Add some bmad stuff for testing 2026-02-03 11:38:15 -05:00
.forgejo/workflows Add Hodor Review workflow (default + security profiles) 2026-08-08 14:14:46 -04:00
.github/workflows Merge pull request 'Update actions/checkout action to v7' (#5) from renovate/actions-checkout-7.x into main 2026-08-09 07:18:27 -04:00
.opencode in sync right now, netbox removed 2026-07-22 16:10:47 -04:00
_bmad Add some bmad stuff for testing 2026-02-03 11:38:15 -05:00
bootstrap/playbooks vibe coded a crapton here 2025-10-08 13:53:38 -04:00
modules Update Terraform routeros to ~> 1.99.0 2026-08-08 21:55:52 +00:00
netbox vibe coded a crapton here 2025-10-08 13:53:38 -04:00
virtualization stupid fucking AI decided that the fucking configuration shouldnt be part of the repo because the configuration is *OBVIOUSLY* sensitive and not worth saving 2026-02-03 12:16:14 -05:00
webhook vibe coded a crapton here 2025-10-08 13:53:38 -04:00
.gitignore stupid fucking AI decided that the fucking configuration shouldnt be part of the repo because the configuration is *OBVIOUSLY* sensitive and not worth saving 2026-02-03 12:16:14 -05:00
.goosehints Update instructions a bit more 2025-11-01 13:22:59 -04:00
.terraform.lock.hcl Add the ptp time server setup 2026-08-29 08:57:23 -04:00
network.auto.tfvars Update it all, add the new riscv64 setup 2026-08-29 09:05:48 -04:00
network.tf add stonks and pmxkids changes to get things going 2026-02-10 16:00:13 -05:00
opencode.json refactor(trunk): enhance trunk module with improved provider handling and VLAN configuration 2026-02-03 11:35:24 -05:00
plan.json Update it all, add the new riscv64 setup 2026-08-29 09:05:48 -04:00
providers.tf pull updates 2026-08-29 08:55:41 -04:00
README.md Correct model number here 2025-10-30 09:58:47 -04:00
renovate.json Add renovate.json 2026-08-08 18:30:30 +00:00
SINGLE_TRUNK_EXAMPLES.md refactor(trunk): enhance trunk module with improved provider handling and VLAN configuration 2026-02-03 11:35:24 -05:00
terraform.tfstate Update it all, add the new riscv64 setup 2026-08-29 09:05:48 -04:00
terraform.tfvars removing netbox from this, wtf is it 2026-07-22 15:58:37 -04:00
TRUNK_DESIGN.md refactor(trunk): enhance trunk module with improved provider handling and VLAN configuration 2026-02-03 11:35:24 -05:00
ultrafast_import.sh base config for the 100gbe switch, need to build out modules/switch/ to handle bonding too 2025-10-22 10:56:11 -04:00
ultrafast_import.tf.reference First pass at DRY for some bits 2025-10-23 18:39:21 -04:00
variables.tf removing netbox from this, wtf is it 2026-07-22 15:58:37 -04:00
vlans.auto.tfvars Add a new wifiap vlan because omada is stupid and wont let me use 4094 there 2026-02-08 21:00:42 -05:00
vlans.tf refactor(trunk): enhance trunk module with improved provider handling and VLAN configuration 2026-02-03 11:35:24 -05:00

MikroTik CRS + Proxmox + NetBox — IaC Starter (Generated)

This repository contains a proof-of-concept Infrastructure-as-Code layout to manage:

What is included

  • network.tf — Main Terraform file to configure the MikroTik switches via the RouterOS Terraform provider.\n- modules/ — Directory containing reusable Terraform modules for switch, VLAN, and VM configurations
  • virtualization/ — Terraform code to create/manage VMs on Proxmox via the Telmate Proxmox provider.
  • netbox/ — YAML import file with the initial NetBox objects for this PoC.
  • bootstrap/ — Ansible playbook to bootstrap RouterOS for API/REST access and create an automation user.
  • webhook/ — Simple Flask webhook receiver to trigger CI runs.
  • .github/workflows/terraform.yml — GitHub Actions workflow for plan/apply (example).

Infrastructure Overview

This setup manages a complex network infrastructure with multiple VLANs and switch configurations:

MikroTik Switches Configuration

The infrastructure includes two MikroTik switches:

  1. gigabit-backbone (192.168.0.32)

    • CRS354-48P-4S+2Q+RM switch model
    • 48 Ethernet ports (ether1-ether48) with various configurations
    • 4 SFP+ ports for fiber connections
    • 2 QSFP+ ports for high-speed connections
    • VLAN tagging and trunking capabilities
  2. ultrafast (192.168.0.33)

    • CRS312+4C+8XG-RM switch model
    • 8 Ethernet ports with PoE support
    • Bonding interfaces for link aggregation
    • Jumbo frame support for high-performance networking

Network VLANs

The network is organized into multiple VLANs with different security levels:

  • Secure VLANs: LAN (VLAN 1), PRIVATE (VLAN 17)
  • Insecure VLANs: IoT (VLAN 8), MEDIA (VLAN 6), CAMSEC (VLAN 20), WORK (VLAN 72)
  • Special purpose VLANs: LTE (VLAN 3), HIGHAV (VLAN 4), JUMBO (VLAN 129)

Modules Directory Structure

The modules/ directory contains reusable Terraform modules:

switch Module

Configures MikroTik switches with complex bridge and VLAN functionality:

  • Bridge creation and configuration
  • Bridge port management with tagging and untagging
  • Ethernet interface configuration (PoE, MTU, flow control)
  • Bonding interface setup
  • VLAN filtering capabilities

vlan Module

Defines VLAN configurations for network segmentation:

  • VLAN ID assignment
  • VLAN name and description
  • Network subnet definitions
  • Reusable across multiple switch configurations

vm Module

Manages Proxmox virtual machines:

  • VM creation with specified resources (cores, memory)
  • Network interface configuration with VLAN tagging
  • Disk configuration
  • VM naming and node assignment

Key Features

  • Complex bridge configurations with VLAN filtering
  • Bonding interfaces for redundancy and increased bandwidth
  • Ethernet port configuration with MTU and PoE settings
  • Trunking of VLANs between switches using tagged port configurations
  • Integration with NetBox for network management

Important: This is a starting point. Do not store secrets in the repository. Use GitHub Secrets / Vault / SOPS / Ansible Vault to protect credentials. Test in a lab before applying to production.

Quickstart (local/lab)

  1. Update variables and provider credentials in the Terraform *.tfvars or environment variables. The files use variables and placeholders.
  2. Run the Ansible playbook in bootstrap/ to configure the switch so the RouterOS API/REST is available to Terraform.
  3. From the root directory run terraform init and terraform plan (or use CI).

See each directory for further notes and config examples.