Skip to content

Commit 5cb45a0

Browse files
committed
Added default value to network_name parameter
1 parent 25c7fec commit 5cb45a0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

builder/olvm/config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
115115
log.Printf("Using default vm_memory_mb: %d", c.VmMemoryMB)
116116
}
117117

118+
// Set default value for network_name if not specified
119+
if c.NetworkName == "" {
120+
c.NetworkName = "ovirtmgmt"
121+
log.Printf("Using default network_name: %s", c.NetworkName)
122+
}
123+
118124
errs = packer.MultiErrorAppend(errs, c.Comm.Prepare(&c.ctx)...)
119125

120126
// Handle SSH timeout after communicator preparation to prevent override

docs/builders/builder.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ source "olvm" "template-example" {
1717
cluster = "Default"
1818
1919
# Network Configuration
20-
network_name = "ovirtmgmt"
20+
network_name = "ovirtmgmt" # Optional (defaults to "ovirtmgmt")
2121
vnic_profile = "ovirtmgmt"
2222
dns_servers = ["8.8.8.8", "8.8.4.4"]
2323
os_interface_name = "ens3" # For systems using predictable network interface names
@@ -61,7 +61,7 @@ source "olvm" "disk-example" {
6161
cluster = "Default"
6262
6363
# Network Configuration
64-
network_name = "ovirtmgmt"
64+
network_name = "ovirtmgmt" # Optional (defaults to "ovirtmgmt")
6565
vnic_profile = "ovirtmgmt"
6666
dns_servers = ["8.8.8.8", "8.8.4.4"]
6767
os_interface_name = "ens3"
@@ -125,7 +125,7 @@ The OLVM builder supports the following parameters:
125125

126126
#### Network Configuration
127127

128-
- `network_name` - Name of the OLVM network to attach to the VM
128+
- `network_name` - Name of the OLVM network to attach to the VM (defaults to "ovirtmgmt")
129129
- `vnic_profile` - vNIC profile to use for the network interface (defaults to `network_name` if not specified)
130130
- `dns_servers` - List of DNS server IP addresses
131131
- `os_interface_name` - Operating system network interface name (defaults to "eth0")

0 commit comments

Comments
 (0)