Skip to content

Commit 52aeba3

Browse files
committed
fix: more tweaks
1 parent 9f3cca1 commit 52aeba3

File tree

2 files changed

+51
-8
lines changed

2 files changed

+51
-8
lines changed

terraform/modules/ros-management-config/services.tf

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ locals {
66
# "www-ssl",
77
"winbox"
88
]
9+
10+
services = {
11+
ftp = { port = 21 }
12+
ssh = { port = 22 }
13+
telnet = { port = 23 }
14+
www = { port = 80 }
15+
www-ssl = { port = 443 }
16+
winbox = { port = 8291 }
17+
api = { port = 8728 }
18+
api-ssl = { port = 8729 }
19+
}
920
}
1021

1122
data "routeros_ip_services" "self" {}
@@ -16,7 +27,9 @@ resource "routeros_ip_service" "self" {
1627
routeros_ip_address.mgmt
1728
]
1829

19-
for_each = { for _, v in data.routeros_ip_services.self.services : v.name => v }
30+
# for_each = { for _, v in data.routeros_ip_services.self.services : v.name => v }
31+
# FIXME: the data source now includes dynamic services, so we get duplicate names
32+
for_each = local.services
2033
numbers = each.key
2134
port = each.value.port
2235
disabled = !contains(local.enabled_services, each.key)
@@ -32,3 +45,7 @@ resource "routeros_ip_ssh_server" "self" {
3245
forwarding_enabled = "remote"
3346
host_key_type = "ed25519"
3447
}
48+
49+
output "debug" {
50+
value = data.routeros_ip_services.self.services
51+
}

terraform/stacks/network-new/main.tf

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,25 @@ module "crs320_bridge" {
1010
sfp-sfpplus1 = {
1111
vlan_ids = [99, 10, 30, 100, 101]
1212
}
13+
sfp-sfpplus3 = {
14+
comment = "pve0"
15+
vlan_ids = [30, 100, 101]
16+
}
17+
sfp-sfpplus4 = {
18+
comment = "pve1"
19+
pvid = 10
20+
# FIXME: tag 10 is only there for home-assistant
21+
vlan_ids = [30, 100, 101]
22+
}
1323
ether1 = {
1424
comment = "office-east"
1525
pvid = 100
1626
vlan_ids = [99]
1727
}
28+
ether2 = {
29+
commment = "rb5009"
30+
pvid = 99
31+
}
1832
ether3 = {
1933
comment = "office-west"
2034
pvid = 100
@@ -44,12 +58,15 @@ module "crs320_bridge" {
4458
pvid = 99
4559
}
4660
ether15 = {
47-
comment = "pve1-ipmi"
61+
comment = "pve1"
4862
pvid = 99
63+
# pvid = 10
64+
# # FIXME: tag 10 is only there for home-assistant
65+
# vlan_ids = [30, 100, 101]
4966
}
5067
ether16 = {
51-
commment = "mgmt"
52-
pvid = 99
68+
comment = "pve1-ipmi"
69+
pvid = 99
5370
}
5471
}
5572

@@ -63,11 +80,20 @@ module "crs320_management_config" {
6380

6481
source = "../../modules/ros-management-config"
6582

66-
bridge_name = module.crs320_bridge.bridge_name
67-
mgmt_vlan_id = 99
68-
oob_mgmt_interface = "ether17"
83+
hostname = "crs320"
84+
bridge_name = module.crs320_bridge.bridge_name
85+
86+
mgmt_cidr_prefix = "10.99.0.0"
87+
mgmt_cidr_bits = 16
88+
mgmt_hostnum = 2
89+
mgmt_vlan_id = 99
90+
91+
oob_mgmt_port = "ether17"
6992
}
7093

7194
output "debug" {
72-
value = var.debug ? module.crs320_bridge.debug : null
95+
value = var.debug ? {
96+
bridge = module.crs320_bridge.debug
97+
mgmt = module.crs320_management_config.debug
98+
}: null
7399
}

0 commit comments

Comments
 (0)