generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Made minor changes to documentation. - Standard `errors` and `fmt` were used for custom errors. - field `Node` was renamed to `Host`. - field `VmTags` was renamed to `Tags` - package `virtual_machine` was renamed to `virtualmachine` - `driver` and `testing` were moved to `common` location
1 parent
08527f1
commit 6fdd994
Showing
24 changed files
with
618 additions
and
587 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
155 changes: 0 additions & 155 deletions
155
.web-docs/components/data-source/virtual_machine/README.md
This file was deleted.
Oops, something went wrong.
160 changes: 160 additions & 0 deletions
160
.web-docs/components/data-source/virtualmachine/README.md
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,160 @@ | ||
Type: `vsphere-virtualmachine` | ||
Artifact BuilderId: `vsphere.virtualmachine` | ||
|
||
This data source retrieves information about existing virtual machines from vSphere | ||
and return name of one virtual machine that matches all specified filters. This virtual | ||
machine can be used in the vSphere Clone builder to select a template. | ||
|
||
## Configuration Reference | ||
|
||
### Filters Configuration | ||
|
||
**Optional:** | ||
|
||
<!-- Code generated from the comments of the Config struct in datasource/virtualmachine/data.go; DO NOT EDIT MANUALLY --> | ||
|
||
- `name` (string) - Basic filter with glob support (e.g. `ubuntu_basic*`). Defaults to `*`. | ||
Using strict globs will not reduce execution time because vSphere API | ||
returns the full inventory. But can be used for better readability over | ||
regular expressions. | ||
|
||
- `name_regex` (string) - Extended name filter with regular expressions support | ||
(e.g. `ubuntu[-_]basic[0-9]*`). Default is empty. The match of the | ||
regular expression is checked by substring. Use `^` and `$` to define a | ||
full string. For example, the `^[^_]+$` filter will search names | ||
without any underscores. The expression must use | ||
[Go Regex Syntax](https://pkg.go.dev/regexp/syntax). | ||
|
||
- `template` (bool) - Filter to return only objects that are virtual machine templates. | ||
Defaults to `false` and returns all virtual machines. | ||
|
||
- `host` (string) - Filter to search virtual machines only on the specified ESX host. | ||
|
||
- `tags` ([]Tag) - Filter to return only that virtual machines that have attached all | ||
specifies tags. Specify one or more `tags` blocks to define list of tags | ||
for the filter. | ||
|
||
- `latest` (bool) - This filter determines how to handle multiple machines that were | ||
matched with all previous filters. Machine creation time is being used | ||
to find latest. By default, multiple matching machines results in an | ||
error. | ||
|
||
<!-- End of code generated from the comments of the Config struct in datasource/virtualmachine/data.go; --> | ||
|
||
|
||
### Tags Filter Configuration | ||
|
||
<!-- Code generated from the comments of the Tag struct in datasource/virtualmachine/data.go; DO NOT EDIT MANUALLY --> | ||
|
||
HCL Example: | ||
|
||
```hcl | ||
tags { | ||
category = "team" | ||
name = "operations" | ||
} | ||
tags { | ||
category = "sla" | ||
name = "gold" | ||
} | ||
``` | ||
|
||
<!-- End of code generated from the comments of the Tag struct in datasource/virtualmachine/data.go; --> | ||
|
||
|
||
**Required:** | ||
|
||
<!-- Code generated from the comments of the Tag struct in datasource/virtualmachine/data.go; DO NOT EDIT MANUALLY --> | ||
|
||
- `name` (string) - Name of the tag added to virtual machine which must pass the `tags` | ||
filter. | ||
|
||
- `category` (string) - Name of the tag category that contains the tag. | ||
|
||
-> **Note:** Both `name` and `category` must be specified in the `tags` | ||
filter. | ||
|
||
<!-- End of code generated from the comments of the Tag struct in datasource/virtualmachine/data.go; --> | ||
|
||
|
||
### Connection Configuration | ||
|
||
**Optional:** | ||
|
||
<!-- Code generated from the comments of the ConnectConfig struct in builder/vsphere/common/step_connect.go; DO NOT EDIT MANUALLY --> | ||
|
||
- `vcenter_server` (string) - The fully qualified domain name or IP address of the vCenter Server | ||
instance. | ||
|
||
- `username` (string) - The username to authenticate with the vCenter Server instance. | ||
|
||
- `password` (string) - The password to authenticate with the vCenter Server instance. | ||
|
||
- `insecure_connection` (bool) - Do not validate the certificate of the vCenter Server instance. | ||
Defaults to `false`. | ||
|
||
-> **Note:** This option is beneficial in scenarios where the certificate | ||
is self-signed or does not meet standard validation criteria. | ||
|
||
- `datacenter` (string) - The name of the datacenter object in the vSphere inventory. | ||
|
||
-> **Note:** Required if more than one datacenter object exists in the | ||
vSphere inventory. | ||
|
||
<!-- End of code generated from the comments of the ConnectConfig struct in builder/vsphere/common/step_connect.go; --> | ||
|
||
|
||
## Output | ||
|
||
<!-- Code generated from the comments of the DatasourceOutput struct in datasource/virtualmachine/data.go; DO NOT EDIT MANUALLY --> | ||
|
||
- `vm_name` (string) - Name of the found virtual machine. | ||
|
||
<!-- End of code generated from the comments of the DatasourceOutput struct in datasource/virtualmachine/data.go; --> | ||
|
||
|
||
## Example Usage | ||
|
||
This example demonstrates how to connect to vSphere cluster and search for the latest virtual machine | ||
that matches the filters. The name of the machine is then output to the console as an output variable. | ||
```hcl | ||
data "vsphere-virtualmachine" "default" { | ||
vcenter_server = "vcenter.example.com" | ||
insecure_connection = true | ||
username = "administrator@vsphere.local" | ||
password = "VMware1!" | ||
datacenter = "dc-01" | ||
latest = true | ||
tags { | ||
category = "team" | ||
name = "operations" | ||
} | ||
tags { | ||
category = "sla" | ||
name = "gold" | ||
} | ||
} | ||
locals { | ||
vm_name = data.vsphere-virtualmachine.default.vm_name | ||
} | ||
source "null" "example" { | ||
communicator = "none" | ||
} | ||
build { | ||
sources = [ | ||
"source.null.example" | ||
] | ||
provisioner "shell-local" { | ||
inline = [ | ||
"echo vm_name: ${local.vm_name}", | ||
] | ||
} | ||
} | ||
``` |
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,60 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package driver | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"net/url" | ||
|
||
"github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common" | ||
"github.com/vmware/govmomi" | ||
"github.com/vmware/govmomi/find" | ||
"github.com/vmware/govmomi/object" | ||
"github.com/vmware/govmomi/vapi/rest" | ||
) | ||
|
||
type VCenterDriver struct { | ||
Ctx context.Context | ||
Client *govmomi.Client | ||
RestClient *rest.Client | ||
Finder *find.Finder | ||
Datacenter *object.Datacenter | ||
} | ||
|
||
func NewDriver(config common.ConnectConfig) (*VCenterDriver, error) { | ||
ctx := context.Background() | ||
|
||
vcenterUrl, err := url.Parse(fmt.Sprintf("https://%v/sdk", config.VCenterServer)) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to parse URL: %w", err) | ||
} | ||
vcenterUrl.User = url.UserPassword(config.Username, config.Password) | ||
|
||
client, err := govmomi.NewClient(ctx, vcenterUrl, true) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to create govmomi Client: %w", err) | ||
} | ||
|
||
restClient := rest.NewClient(client.Client) | ||
err = restClient.Login(ctx, vcenterUrl.User) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to login to REST API endpoint: %w", err) | ||
} | ||
|
||
finder := find.NewFinder(client.Client, true) | ||
datacenter, err := finder.DatacenterOrDefault(ctx, config.Datacenter) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to find datacenter: %w", err) | ||
} | ||
finder.SetDatacenter(datacenter) | ||
|
||
return &VCenterDriver{ | ||
Ctx: ctx, | ||
Client: client, | ||
RestClient: restClient, | ||
Finder: finder, | ||
Datacenter: datacenter, | ||
}, nil | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
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
10 changes: 5 additions & 5 deletions
10
datasource/virtual_machine/data.hcl2spec.go → datasource/virtualmachine/data.hcl2spec.go
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package virtualmachine | ||
|
||
import ( | ||
"fmt" | ||
"regexp" | ||
"time" | ||
|
||
"github.com/hashicorp/packer-plugin-vsphere/datasource/common/driver" | ||
"github.com/vmware/govmomi/object" | ||
"github.com/vmware/govmomi/property" | ||
"github.com/vmware/govmomi/vapi/tags" | ||
"github.com/vmware/govmomi/vim25/mo" | ||
) | ||
|
||
// filterByNameRegex filters machines by matching their names against defined regular expression. | ||
func filterByNameRegex(vmList []*object.VirtualMachine, nameRegex string) []*object.VirtualMachine { | ||
re, _ := regexp.Compile(nameRegex) | ||
result := make([]*object.VirtualMachine, 0) | ||
for _, i := range vmList { | ||
if re.MatchString(i.Name()) { | ||
result = append(result, i) | ||
} | ||
} | ||
return result | ||
} | ||
|
||
// filterByTemplate filters machines by template attribute. Only templates will pass the filter. | ||
func filterByTemplate(driver *driver.VCenterDriver, vmList []*object.VirtualMachine) ([]*object.VirtualMachine, error) { | ||
result := make([]*object.VirtualMachine, 0) | ||
for _, i := range vmList { | ||
isTemplate, err := i.IsTemplate(driver.Ctx) | ||
if err != nil { | ||
return nil, fmt.Errorf("error checking if virtual machine is a template: %w", err) | ||
} | ||
|
||
if isTemplate { | ||
result = append(result, i) | ||
} | ||
} | ||
return result, nil | ||
} | ||
|
||
// filterByHost filters machines by ESX host placement. | ||
// Only machines that are stored on the defined host will pass the filter. | ||
func filterByHost(driver *driver.VCenterDriver, config Config, vmList []*object.VirtualMachine) ([]*object.VirtualMachine, error) { | ||
pc := property.DefaultCollector(driver.Client.Client) | ||
obj, err := driver.Finder.HostSystem(driver.Ctx, config.Host) | ||
if err != nil { | ||
return nil, fmt.Errorf("error finding defined host system: %w", err) | ||
} | ||
|
||
var host mo.HostSystem | ||
err = pc.RetrieveOne(driver.Ctx, obj.Reference(), []string{"vm"}, &host) | ||
if err != nil { | ||
return nil, fmt.Errorf("error retrieving properties of host system: %w", err) | ||
} | ||
|
||
var hostVms []mo.VirtualMachine | ||
err = pc.Retrieve(driver.Ctx, host.Vm, []string{"name"}, &hostVms) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to get properties for the virtual machine: %w", err) | ||
} | ||
|
||
result := make([]*object.VirtualMachine, 0) | ||
for _, filteredVm := range vmList { | ||
vmName := filteredVm.Name() | ||
for _, hostVm := range hostVms { | ||
if vmName == hostVm.Name { | ||
result = append(result, filteredVm) | ||
} | ||
} | ||
} | ||
|
||
return result, nil | ||
} | ||
|
||
// filterByTags filters machines by tags. Only machines that has all the tags from list will pass the filter. | ||
func filterByTags(driver *driver.VCenterDriver, vmTags []Tag, vmList []*object.VirtualMachine) ([]*object.VirtualMachine, error) { | ||
result := make([]*object.VirtualMachine, 0) | ||
tagMan := tags.NewManager(driver.RestClient) | ||
for _, filteredVm := range vmList { | ||
realTagsList, err := tagMan.GetAttachedTags(driver.Ctx, filteredVm.Reference()) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed return tags for the virtual machine: %w", err) | ||
} | ||
matchedTagsCount := 0 | ||
for _, configTag := range vmTags { | ||
configTagMatched := false | ||
for _, realTag := range realTagsList { | ||
if configTag.Name == realTag.Name { | ||
category, err := tagMan.GetCategory(driver.Ctx, realTag.CategoryID) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to return tag category for tag: %w", err) | ||
} | ||
if configTag.Category == category.Name { | ||
configTagMatched = true | ||
break | ||
} | ||
} | ||
} | ||
if configTagMatched { | ||
matchedTagsCount++ | ||
} else { | ||
// If a single requested tag from config not matched then no need to proceed. | ||
// Fail early. | ||
break | ||
} | ||
} | ||
if matchedTagsCount == len(vmTags) { | ||
result = append(result, filteredVm) | ||
} | ||
} | ||
|
||
return result, nil | ||
} | ||
|
||
// filterByLatest filters machines by creation date. This filter returns list with one element. | ||
func filterByLatest(driver *driver.VCenterDriver, vmList []*object.VirtualMachine) ([]*object.VirtualMachine, error) { | ||
var latestVM *object.VirtualMachine | ||
var latestTimestamp time.Time | ||
for _, elementVM := range vmList { | ||
var vmConfig mo.VirtualMachine | ||
err := elementVM.Properties(driver.Ctx, elementVM.Reference(), []string{"config"}, &vmConfig) | ||
if err != nil { | ||
return nil, fmt.Errorf("error retrieving config properties for the virtual machine: %w", err) | ||
} | ||
if vmConfig.Config.CreateDate.After(latestTimestamp) { | ||
latestVM = elementVM | ||
latestTimestamp = *vmConfig.Config.CreateDate | ||
} | ||
} | ||
result := []*object.VirtualMachine{latestVM} | ||
return result, nil | ||
} |
26 changes: 0 additions & 26 deletions
26
docs-partials/datasource/virtual_machine/Config-not-required.mdx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
docs-partials/datasource/virtualmachine/Config-not-required.mdx
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,29 @@ | ||
<!-- Code generated from the comments of the Config struct in datasource/virtualmachine/data.go; DO NOT EDIT MANUALLY --> | ||
|
||
- `name` (string) - Basic filter with glob support (e.g. `ubuntu_basic*`). Defaults to `*`. | ||
Using strict globs will not reduce execution time because vSphere API | ||
returns the full inventory. But can be used for better readability over | ||
regular expressions. | ||
|
||
- `name_regex` (string) - Extended name filter with regular expressions support | ||
(e.g. `ubuntu[-_]basic[0-9]*`). Default is empty. The match of the | ||
regular expression is checked by substring. Use `^` and `$` to define a | ||
full string. For example, the `^[^_]+$` filter will search names | ||
without any underscores. The expression must use | ||
[Go Regex Syntax](https://pkg.go.dev/regexp/syntax). | ||
|
||
- `template` (bool) - Filter to return only objects that are virtual machine templates. | ||
Defaults to `false` and returns all virtual machines. | ||
|
||
- `host` (string) - Filter to search virtual machines only on the specified ESX host. | ||
|
||
- `tags` ([]Tag) - Filter to return only that virtual machines that have attached all | ||
specifies tags. Specify one or more `tags` blocks to define list of tags | ||
for the filter. | ||
|
||
- `latest` (bool) - This filter determines how to handle multiple machines that were | ||
matched with all previous filters. Machine creation time is being used | ||
to find latest. By default, multiple matching machines results in an | ||
error. | ||
|
||
<!-- End of code generated from the comments of the Config struct in datasource/virtualmachine/data.go; --> |
4 changes: 2 additions & 2 deletions
4
...urce/virtual_machine/DatasourceOutput.mdx → ...ource/virtualmachine/DatasourceOutput.mdx
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,5 +1,5 @@ | ||
<!-- Code generated from the comments of the DatasourceOutput struct in datasource/virtual_machine/data.go; DO NOT EDIT MANUALLY --> | ||
<!-- Code generated from the comments of the DatasourceOutput struct in datasource/virtualmachine/data.go; DO NOT EDIT MANUALLY --> | ||
|
||
- `vm_name` (string) - Name of the found virtual machine. | ||
|
||
<!-- End of code generated from the comments of the DatasourceOutput struct in datasource/virtual_machine/data.go; --> | ||
<!-- End of code generated from the comments of the DatasourceOutput struct in datasource/virtualmachine/data.go; --> |
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,11 @@ | ||
<!-- Code generated from the comments of the Tag struct in datasource/virtualmachine/data.go; DO NOT EDIT MANUALLY --> | ||
|
||
- `name` (string) - Name of the tag added to virtual machine which must pass the `tags` | ||
filter. | ||
|
||
- `category` (string) - Name of the tag category that contains the tag. | ||
|
||
-> **Note:** Both `name` and `category` must be specified in the `tags` | ||
filter. | ||
|
||
<!-- End of code generated from the comments of the Tag struct in datasource/virtualmachine/data.go; --> |
15 changes: 8 additions & 7 deletions
15
...rtials/datasource/virtual_machine/Tag.mdx → ...artials/datasource/virtualmachine/Tag.mdx
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,17 +1,18 @@ | ||
<!-- Code generated from the comments of the Tag struct in datasource/virtual_machine/data.go; DO NOT EDIT MANUALLY --> | ||
<!-- Code generated from the comments of the Tag struct in datasource/virtualmachine/data.go; DO NOT EDIT MANUALLY --> | ||
|
||
Example of multiple vm_tags blocks in HCL format: | ||
``` | ||
HCL Example: | ||
|
||
```hcl | ||
|
||
vm_tags { | ||
tags { | ||
category = "team" | ||
name = "operations" | ||
} | ||
vm_tags { | ||
category = "SLA" | ||
tags { | ||
category = "sla" | ||
name = "gold" | ||
} | ||
|
||
``` | ||
|
||
<!-- End of code generated from the comments of the Tag struct in datasource/virtual_machine/data.go; --> | ||
<!-- End of code generated from the comments of the Tag struct in datasource/virtualmachine/data.go; --> |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
modeline: | | ||
vim: set ft=pandoc: | ||
description: | | ||
This data source retrieves information about existing virtual machines from vSphere | ||
and return name of one virtual machine that matches all specified filters. This virtual | ||
machine can be used in the vSphere Clone builder to select a template. | ||
page_title: vSphere Virtual Machine - Data Source | ||
sidebar_title: vSphere Virtual Machine | ||
--- | ||
|
||
# Virtual Machine Data Source | ||
|
||
Type: `vsphere-virtualmachine` | ||
Artifact BuilderId: `vsphere.virtualmachine` | ||
|
||
This data source retrieves information about existing virtual machines from vSphere | ||
and return name of one virtual machine that matches all specified filters. This virtual | ||
machine can be used in the vSphere Clone builder to select a template. | ||
|
||
## Configuration Reference | ||
|
||
### Filters Configuration | ||
|
||
**Optional:** | ||
|
||
@include 'datasource/virtualmachine/Config-not-required.mdx' | ||
|
||
### Tags Filter Configuration | ||
|
||
@include 'datasource/virtualmachine/Tag.mdx' | ||
|
||
**Required:** | ||
|
||
@include 'datasource/virtualmachine/Tag-required.mdx' | ||
|
||
### Connection Configuration | ||
|
||
**Optional:** | ||
|
||
@include 'builder/vsphere/common/ConnectConfig-not-required.mdx' | ||
|
||
## Output | ||
|
||
@include 'datasource/virtualmachine/DatasourceOutput.mdx' | ||
|
||
## Example Usage | ||
|
||
This example demonstrates how to connect to vSphere cluster and search for the latest virtual machine | ||
that matches the filters. The name of the machine is then output to the console as an output variable. | ||
```hcl | ||
data "vsphere-virtualmachine" "default" { | ||
vcenter_server = "vcenter.example.com" | ||
insecure_connection = true | ||
username = "administrator@vsphere.local" | ||
password = "VMware1!" | ||
datacenter = "dc-01" | ||
latest = true | ||
tags { | ||
category = "team" | ||
name = "operations" | ||
} | ||
tags { | ||
category = "sla" | ||
name = "gold" | ||
} | ||
} | ||
locals { | ||
vm_name = data.vsphere-virtualmachine.default.vm_name | ||
} | ||
source "null" "example" { | ||
communicator = "none" | ||
} | ||
build { | ||
sources = [ | ||
"source.null.example" | ||
] | ||
provisioner "shell-local" { | ||
inline = [ | ||
"echo vm_name: ${local.vm_name}", | ||
] | ||
} | ||
} | ||
``` |
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