|
1 | | -# ============================================ |
2 | | -# NETBIRD DEPLOYMENT CONFIGURATION |
3 | | -# ============================================ |
| 1 | +# ============================================================================= |
| 2 | +# NETBIRD TERRAFORM + ANSIBLE STACK - CONFIGURATION EXAMPLE |
| 3 | +# ============================================================================= |
| 4 | +# Use this file as a template for your deployment. |
| 5 | +# Copy it to 'terraform.tfvars' and update the values. |
| 6 | +# ============================================================================= |
4 | 7 |
|
5 | | -# Define your hosts and their roles here |
6 | | -# Roles: management, relay, proxy |
7 | | -# For single-node deployment, assign all roles to one host |
| 8 | +# ----------------------------------------------------------------------------- |
| 9 | +# 1. Environment & Network |
| 10 | +# ----------------------------------------------------------------------------- |
| 11 | +environment = "prod" |
| 12 | +aws_region = "us-east-1" |
| 13 | +netbird_domain = "vpn.example.com" |
| 14 | + |
| 15 | +# ----------------------------------------------------------------------------- |
| 16 | +# 2. Inventory Configuration |
| 17 | +# ----------------------------------------------------------------------------- |
| 18 | +# Map your servers to roles: management, relay, proxy |
| 19 | +# For a single-node setup, assign all roles to one host. |
8 | 20 | netbird_hosts = { |
9 | | - "netbird-server" = { |
10 | | - public_ip = "1.2.3.4" |
11 | | - private_ip = "10.0.0.1" |
| 21 | + "netbird-main" = { |
| 22 | + public_ip = "1.2.3.4" # Public IP reachable by clients and Ansible |
| 23 | + private_ip = "10.0.0.1" # Optional: Internal IP for inter-service communication |
12 | 24 | roles = ["management", "relay", "proxy"] |
13 | | - ssh_user = "ubuntu" |
| 25 | + ssh_user = "ubuntu" # Default user for Ansible connection |
14 | 26 | } |
15 | 27 | } |
16 | 28 |
|
17 | | -# Database Backend Selection |
| 29 | +# ----------------------------------------------------------------------------- |
| 30 | +# 3. Database Selection |
| 31 | +# ----------------------------------------------------------------------------- |
| 32 | + |
| 33 | +# --- OPTION A: SQLite (Simpler, local file) --- |
18 | 34 | database_type = "sqlite" |
19 | | -database_mode = "existing" |
20 | 35 | sqlite_database_path = "/var/lib/netbird/store.db" |
21 | | -enable_ha = false |
22 | 36 |
|
23 | | -# Common Variables |
24 | | -netbird_domain = "vpn.example.com" |
25 | | -environment = "prod" |
| 37 | +# --- OPTION B: Existing PostgreSQL (Recommended for production) --- |
| 38 | +# database_type = "postgresql" |
| 39 | +# database_mode = "existing" |
| 40 | +# existing_postgresql_host = "db.example.com" |
| 41 | +# existing_postgresql_port = 5432 |
| 42 | +# existing_postgresql_database = "netbird" |
| 43 | +# existing_postgresql_username = "netbird_user" |
| 44 | +# existing_postgresql_password = "REPLACE_WITH_SECURE_PASSWORD" |
| 45 | +# existing_postgresql_sslmode = "require" |
26 | 46 |
|
27 | | -# Keycloak Configuration |
28 | | -keycloak_url = "https://keycloak.example.com/auth" |
| 47 | +# --- OPTION C: Create Managed PostgreSQL (Cloud-native) --- |
| 48 | +# database_type = "postgresql" |
| 49 | +# database_mode = "create" |
| 50 | +# cloud_provider = "aws" # options: aws, gcp, azure |
| 51 | +# postgresql_instance_class = "db.t3.medium" |
| 52 | +# postgresql_storage_gb = 20 |
| 53 | +# postgresql_database_name = "netbird" |
| 54 | +# postgresql_username = "netbird_admin" |
| 55 | +# postgresql_password = "REPLACE_WITH_SECURE_PASSWORD" |
| 56 | +# postgresql_multi_az = false # set to true for high availability |
| 57 | +# postgresql_backup_retention_days = 7 |
| 58 | + |
| 59 | +# ----------------------------------------------------------------------------- |
| 60 | +# 4. Identity Provider (Keycloak) Configuration |
| 61 | +# ----------------------------------------------------------------------------- |
| 62 | +# NetBird requires an OIDC provider. This module configures a Keycloak realm. |
| 63 | +keycloak_url = "https://keycloak.example.com" |
29 | 64 | keycloak_admin_username = "admin" |
30 | | -keycloak_admin_password = "CHANGE_ME" |
| 65 | +keycloak_admin_password = "REPLACE_WITH_KEYCLOAK_ADMIN_PASSWORD" |
31 | 66 | keycloak_use_existing_realm = false |
| 67 | +realm_name = "netbird" |
| 68 | + |
| 69 | +# ----------------------------------------------------------------------------- |
| 70 | +# 5. NetBird Application Secrets |
| 71 | +# ----------------------------------------------------------------------------- |
| 72 | +# Default NetBird Dashboard Administrator |
| 73 | +netbird_admin_email = "admin@example.com" |
| 74 | +netbird_admin_password = "REPLACE_WITH_SECURE_ADMIN_PASSWORD" |
32 | 75 |
|
33 | | -# Authentication Secrets (Leave empty to generate automatically) |
34 | | -relay_auth_secret = "" |
35 | | -netbird_encryption_key = "" |
36 | | -netbird_log_level = "info" |
| 76 | +# Secrets generation: |
| 77 | +# If left empty, Terraform will generate secure random strings automatically. |
| 78 | +relay_auth_secret = "" |
| 79 | +netbird_encryption_key = "" # 32-byte base64 key for sensitive data at rest |
| 80 | +netbird_log_level = "info" |
37 | 81 |
|
38 | | -# Default Administrator |
39 | | -netbird_admin_email = "admin@example.com" |
40 | | -netbird_admin_password = "CHANGE_ME" |
| 82 | +# ----------------------------------------------------------------------------- |
| 83 | +# 6. Version Pinning |
| 84 | +# ----------------------------------------------------------------------------- |
| 85 | +netbird_version = "latest" |
| 86 | +caddy_version = "latest" |
| 87 | +docker_compose_version = "v2.24.0" |
41 | 88 |
|
42 | | -# SSH Configuration for Ansible |
43 | | -ssh_private_key_path = "~/.ssh/id_rsa" |
| 89 | +# ----------------------------------------------------------------------------- |
| 90 | +# 7. Ansible Connection Settings |
| 91 | +# ----------------------------------------------------------------------------- |
| 92 | +# Path to the private key used to SSH into 'netbird_hosts' |
| 93 | +ssh_private_key_path = "~/.ssh/id_rsa" |
0 commit comments