Merge pull request #84 from ddelnano/ddelnano/allow-not-specifying-xs-tools

Allow users to specify if xs tools should be managed by packer or not
This commit is contained in:
Dom Del Nano 2023-07-07 08:08:21 -07:00 committed by GitHub
commit 524ef18847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 25 deletions

View File

@ -76,10 +76,6 @@ func (c *CommonConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig
c.RawBootWait = "5s"
}
if c.ToolsIsoName == "" {
c.ToolsIsoName = "xs-tools.iso"
}
if c.HTTPPortMin == 0 {
c.HTTPPortMin = 8000
}

View File

@ -4,11 +4,10 @@ import (
"reflect"
"testing"
"github.com/hashicorp/packer-plugin-sdk/packer"
"github.com/hashicorp/packer-plugin-sdk/common"
"github.com/hashicorp/packer-plugin-sdk/packer"
)
func testConfig() map[string]interface{} {
return map[string]interface{}{
"remote_host": "localhost",
@ -43,7 +42,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
t.Fatalf("should not have error: %s", err)
}
if b.config.ToolsIsoName != "xs-tools.iso" {
if b.config.ToolsIsoName != "" {
t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName)
}
@ -201,10 +200,8 @@ func TestBuilderPrepare_ISOChecksum(t *testing.T) {
t.Fatal("should have error")
}
}
func TestBuilderPrepare_ISOUrl(t *testing.T) {
var b Builder
config := testConfig()

View File

@ -3,8 +3,8 @@ package xva
import (
"testing"
"github.com/hashicorp/packer-plugin-sdk/packer"
"github.com/hashicorp/packer-plugin-sdk/common"
"github.com/hashicorp/packer-plugin-sdk/packer"
)
func testConfig() map[string]interface{} {
@ -40,7 +40,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
t.Fatalf("should not have error: %s", err)
}
if b.config.ToolsIsoName != "xs-tools.iso" {
if b.config.ToolsIsoName != "" {
t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName)
}

View File

@ -133,6 +133,9 @@ each category, the available options are alphabetized and described.
must point to the same file (same checksum). By default this is empty
and `iso_url` is used. Only one of `iso_url` or `iso_urls` can be specified.
* `tools_iso_name` (string) - Choose the tools iso you want to use.
Usually "guest-tools.iso", or "xs-tools.iso". Not setting this variable won't plug any tools.
* `keep_vm` (string) - Determine when to keep the VM and when to clean it up. This
can be "always", "never" or "on_success". By default this is "never", and Packer
always deletes the VM regardless of whether the process succeeded and an artifact

View File

@ -1,6 +0,0 @@
{
"builders": [{
"type": "xenserver-iso",
"tools_iso_name": "guest-tools.iso"
}]
}