Skip to content

Commit 524ef18

Browse files
authored
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
2 parents 767809c + dac47c6 commit 524ef18

5 files changed

Lines changed: 15 additions & 25 deletions

File tree

builder/xenserver/common/common_config.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ func (c *CommonConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig
7676
c.RawBootWait = "5s"
7777
}
7878

79-
if c.ToolsIsoName == "" {
80-
c.ToolsIsoName = "xs-tools.iso"
81-
}
82-
8379
if c.HTTPPortMin == 0 {
8480
c.HTTPPortMin = 8000
8581
}

builder/xenserver/iso/builder_test.go

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@ import (
44
"reflect"
55
"testing"
66

7-
"github.com/hashicorp/packer-plugin-sdk/packer"
87
"github.com/hashicorp/packer-plugin-sdk/common"
8+
"github.com/hashicorp/packer-plugin-sdk/packer"
99
)
1010

11-
1211
func testConfig() map[string]interface{} {
1312
return map[string]interface{}{
14-
"remote_host": "localhost",
15-
"remote_username": "admin",
16-
"remote_password": "admin",
17-
"vm_name": "foo",
18-
"iso_checksum": "md5:A221725EE181A44C67E25BD6A2516742",
19-
"iso_url": "http://www.google.com/",
20-
"shutdown_command": "yes",
21-
"ssh_username": "foo",
13+
"remote_host": "localhost",
14+
"remote_username": "admin",
15+
"remote_password": "admin",
16+
"vm_name": "foo",
17+
"iso_checksum": "md5:A221725EE181A44C67E25BD6A2516742",
18+
"iso_url": "http://www.google.com/",
19+
"shutdown_command": "yes",
20+
"ssh_username": "foo",
2221

2322
common.BuildNameConfigKey: "foo",
2423
}
@@ -43,7 +42,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
4342
t.Fatalf("should not have error: %s", err)
4443
}
4544

46-
if b.config.ToolsIsoName != "xs-tools.iso" {
45+
if b.config.ToolsIsoName != "" {
4746
t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName)
4847
}
4948

@@ -201,10 +200,8 @@ func TestBuilderPrepare_ISOChecksum(t *testing.T) {
201200
t.Fatal("should have error")
202201
}
203202

204-
205203
}
206204

207-
208205
func TestBuilderPrepare_ISOUrl(t *testing.T) {
209206
var b Builder
210207
config := testConfig()

builder/xenserver/xva/builder_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package xva
33
import (
44
"testing"
55

6-
"github.com/hashicorp/packer-plugin-sdk/packer"
76
"github.com/hashicorp/packer-plugin-sdk/common"
7+
"github.com/hashicorp/packer-plugin-sdk/packer"
88
)
99

1010
func testConfig() map[string]interface{} {
@@ -40,7 +40,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
4040
t.Fatalf("should not have error: %s", err)
4141
}
4242

43-
if b.config.ToolsIsoName != "xs-tools.iso" {
43+
if b.config.ToolsIsoName != "" {
4444
t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName)
4545
}
4646

docs/builders/iso/xenserver-iso.html.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ each category, the available options are alphabetized and described.
133133
must point to the same file (same checksum). By default this is empty
134134
and `iso_url` is used. Only one of `iso_url` or `iso_urls` can be specified.
135135

136+
* `tools_iso_name` (string) - Choose the tools iso you want to use.
137+
Usually "guest-tools.iso", or "xs-tools.iso". Not setting this variable won't plug any tools.
138+
136139
* `keep_vm` (string) - Determine when to keep the VM and when to clean it up. This
137140
can be "always", "never" or "on_success". By default this is "never", and Packer
138141
always deletes the VM regardless of whether the process succeeded and an artifact

packer.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)