Skip to content

Commit 00a48df

Browse files
authored
Merge pull request #1 from sbrueseke/add_console_endpoint_access
Add console endpoint access
2 parents b3003c9 + 8ca0db6 commit 00a48df

25 files changed

Lines changed: 333 additions & 39 deletions

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/packer-plugin-cloudstack.iml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ With this parameter you can override the default value of the port the packer cl
4141

4242

4343
More info
44-
https://github.com/sbrueseke/packer-plugin-cloudstack
44+
https://github.com/apache/packer-plugin-cloudstack
4545
https://developer.hashicorp.com/packer/integrations/hashicorp/qemu/latest/components/builder/qemu
4646
https://developer.hashicorp.com/packer/integrations/hashicorp/qemu/latest/components/builder/qemu#boot-configuration
4747
https://developer.hashicorp.com/packer/integrations/hashicorp/cloudstack/latest/components/builder/cloudstack

builder/cloudstack/artifact.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ package cloudstack
55

66
import (
77
"fmt"
8+
"github.com/apache/cloudstack-go/v2/cloudstack"
89
"log"
910
"strings"
10-
11-
"github.com/apache/cloudstack-go/v2/cloudstack"
1211
)
1312

1413
// Artifact represents a CloudStack template as the result of a Packer build.

builder/cloudstack/artifact_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package cloudstack
55

66
import (
7+
"github.com/apache/cloudstack-go/v2/cloudstack"
78
"testing"
89

9-
"github.com/apache/cloudstack-go/v2/cloudstack"
1010
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
1111
)
1212

builder/cloudstack/builder.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package cloudstack
66
import (
77
"context"
88
"fmt"
9-
109
"github.com/apache/cloudstack-go/v2/cloudstack"
10+
1111
"github.com/hashicorp/hcl/v2/hcldec"
1212
"github.com/hashicorp/packer-plugin-sdk/communicator"
1313
"github.com/hashicorp/packer-plugin-sdk/multistep"
@@ -76,6 +76,17 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
7676
},
7777
&stepSetupNetworking{},
7878
&stepDetachIso{},
79+
&stepSetUpVNC{
80+
VNCEnabled: !b.config.DisableVNC,
81+
WebsocketURL: b.config.WebsocketURL,
82+
InsecureConnection: b.config.InsecureConnection,
83+
},
84+
&stepBootCommandVNC{
85+
VNCEnabled: !b.config.DisableVNC,
86+
Config: b.config.VNCConfig,
87+
BootWait: b.config.BootWait,
88+
Ctx: b.config.ctx,
89+
},
7990
&communicator.StepConnect{
8091
Config: &b.config.Comm,
8192
Host: communicator.CommHost(b.config.Comm.Host(), "ipaddress"),

builder/cloudstack/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package cloudstack
99
import (
1010
"errors"
1111
"fmt"
12+
"github.com/hashicorp/packer-plugin-sdk/bootcommand"
1213
"os"
1314
"time"
1415

@@ -26,6 +27,7 @@ type Config struct {
2627
common.PackerConfig `mapstructure:",squash"`
2728
commonsteps.HTTPConfig `mapstructure:",squash"`
2829
Comm communicator.Config `mapstructure:",squash"`
30+
bootcommand.VNCConfig `mapstructure:",squash"`
2931

3032
// The CloudStack API endpoint we will connect to. It can
3133
// also be specified via environment variable CLOUDSTACK_API_URL, if set.
@@ -166,6 +168,11 @@ type Config struct {
166168

167169
Tags map[string]string `mapstructure:"tags"`
168170

171+
WebsocketURL string `mapstructure:"websocket_url" required:"false"`
172+
173+
// Do not validate VNC over websocket server's TLS certificate. Defaults to `false`.
174+
InsecureConnection bool `mapstructure:"insecure_connection" required:"false"`
175+
169176
ctx interpolate.Context
170177
}
171178

@@ -177,6 +184,7 @@ func (c *Config) Prepare(raws ...interface{}) error {
177184
InterpolateFilter: &interpolate.RenderFilter{
178185
Exclude: []string{
179186
"user_data",
187+
"boot_command",
180188
},
181189
},
182190
}, raws...)

0 commit comments

Comments
 (0)