Skip to content

Commit d03b546

Browse files
Fix NIC changing name
1 parent e8c0c58 commit d03b546

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ module "nodes" {
116116
vcpu = 1
117117
pool = "terra_pool"
118118
system_volume = 20
119+
share_filesystem = {
120+
source = "/tmp"
121+
target = "tmp"
122+
readonly = false
123+
}
119124
120125
dhcp = false
121126
ip_address = [

modules/virt-machine/cloud_init.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ data "template_file" "network_config" {
55
ip_address = element(var.ip_address, count.index)
66
ip_gateway = var.ip_gateway
77
ip_nameserver = var.ip_nameserver
8+
nic = "${var.share_filesystem.source == null ? "ens3" : "ens4"}"
9+
# WA: If the shared filesystem is used, Libvirt connects Unclassified device to the 3rd position of PCI bus
810
}
911
}
1012

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
version: 2
22
ethernets:
3-
ens3:
3+
${nic}:
44
dhcp4: true

modules/virt-machine/templates/network_config_static.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
ethernets:
3-
ens3:
3+
${nic}:
44
dhcp4: no
55
addresses: [${ip_address}/24]
66
gateway4: ${ip_gateway}

0 commit comments

Comments
 (0)