generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expand switch / adapter configuration.
Signed-off-by: Greg Althaus <[email protected]>
- Loading branch information
Showing
32 changed files
with
801 additions
and
627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
main | ||
dist/* | ||
packer-plugin-scaffolding | ||
packer-plugin-hyperv | ||
.docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
//go:generate packer-sdc struct-markdown | ||
//go:generate packer-sdc mapstructure-to-hcl2 -type AdapterConfig | ||
|
||
package common | ||
|
||
import ( | ||
"github.com/hashicorp/packer-plugin-sdk/common" | ||
"github.com/hashicorp/packer-plugin-sdk/template/interpolate" | ||
) | ||
|
||
type AdapterConfig struct { | ||
// The name of the network adapter. | ||
// By default, leaving this value unset will cause Packer to | ||
// try and determine the switch to use by looking for an external switch | ||
// that is up and running. | ||
Name string `mapstructure:"adapter_name" required:"false"` | ||
// The name of the switch for this adapter | ||
SwitchName string `mapstructure:"switch_name" required:"false"` | ||
// This is the VLAN of the virtual switch's | ||
// network card. By default, none is set. If none is set then a VLAN is not | ||
// set on the switch's network card. If this value is set it should match | ||
// the VLAN specified in by vlan_id. | ||
VlanId string `mapstructure:"vlan_id" required:"false"` | ||
// This allows a specific MAC address to be used on | ||
// the default main virtual network card. The MAC address must be a string with | ||
// no delimiters, for example "037777777777deadbeef". | ||
MacAddress string `mapstructure:"mac_address" required:"false"` | ||
} | ||
|
||
func (ac AdapterConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) ([]error, []string) { | ||
return nil, nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.