No description
Find a file
2026-02-08 07:26:33 -05: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
.github/workflows
.opencode/command Add some bmad stuff for testing 2026-02-03 11:38:15 -05:00
_bmad Add some bmad stuff for testing 2026-02-03 11:38:15 -05:00
_bmad-output/implementation-artifacts Add Netbox provider integration for network documentation 2026-02-03 13:58:33 -05:00
bootstrap/playbooks
modules Alright stuff is mostly there and working I think! 2026-02-06 12:48:57 -05:00
netbox
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
.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
netbox.tf getting there, make a backup before i wipte the backup files 2026-02-07 18:34:55 -05:00
network.auto.tfvars getting there, make a backup before i wipte the backup files 2026-02-07 18:34:55 -05:00
network.tf Update! 2026-02-08 07:26:33 -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! 2026-02-08 07:26:33 -05:00
providers.tf
README.md Correct model number here 2025-10-30 09:58:47 -04: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! 2026-02-08 07:26:33 -05:00
terraform.tfvars 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
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
ultrafast_import.tf.reference First pass at DRY for some bits 2025-10-23 18:39:21 -04:00
variables.tf Fix LAG duplication and document cable interface references 2026-02-03 15:32:44 -05:00
vlans.auto.tfvars Alright stuff is mostly there and working I think! 2026-02-06 12:48:57 -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.