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:
commit
524ef18847
@ -76,10 +76,6 @@ func (c *CommonConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig
|
|||||||
c.RawBootWait = "5s"
|
c.RawBootWait = "5s"
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.ToolsIsoName == "" {
|
|
||||||
c.ToolsIsoName = "xs-tools.iso"
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.HTTPPortMin == 0 {
|
if c.HTTPPortMin == 0 {
|
||||||
c.HTTPPortMin = 8000
|
c.HTTPPortMin = 8000
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,10 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer-plugin-sdk/packer"
|
|
||||||
"github.com/hashicorp/packer-plugin-sdk/common"
|
"github.com/hashicorp/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer-plugin-sdk/packer"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
func testConfig() map[string]interface{} {
|
func testConfig() map[string]interface{} {
|
||||||
return map[string]interface{}{
|
return map[string]interface{}{
|
||||||
"remote_host": "localhost",
|
"remote_host": "localhost",
|
||||||
@ -43,7 +42,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
|
|||||||
t.Fatalf("should not have error: %s", err)
|
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)
|
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")
|
t.Fatal("should have error")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func TestBuilderPrepare_ISOUrl(t *testing.T) {
|
func TestBuilderPrepare_ISOUrl(t *testing.T) {
|
||||||
var b Builder
|
var b Builder
|
||||||
config := testConfig()
|
config := testConfig()
|
||||||
|
@ -3,8 +3,8 @@ package xva
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer-plugin-sdk/packer"
|
|
||||||
"github.com/hashicorp/packer-plugin-sdk/common"
|
"github.com/hashicorp/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer-plugin-sdk/packer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testConfig() map[string]interface{} {
|
func testConfig() map[string]interface{} {
|
||||||
@ -40,7 +40,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
|
|||||||
t.Fatalf("should not have error: %s", err)
|
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)
|
t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
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.
|
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
|
* `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
|
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
|
always deletes the VM regardless of whether the process succeeded and an artifact
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"builders": [{
|
|
||||||
"type": "xenserver-iso",
|
|
||||||
"tools_iso_name": "guest-tools.iso"
|
|
||||||
}]
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user