Commit Graph

54 Commits

Author SHA1 Message Date
Joshua Foster d35f342319 add the ability to configure the http bind address. defaults to 0.0.0.0. 2020-06-03 16:40:18 -07:00
RedTail72 374f82b978
buidler/vsphere-iso: ISOUrl Fix (#9321)
* ISOUrl Fix

Added the check for ISOUrls back in addition to a check for RawSingleISOUrl.  This should allow both ISOUrls[] or ISOUrl to work while not requiring them all the time.

* Update config.go

Fixed formatting.
2020-06-01 15:27:26 -04:00
Adrien Delorme 40947c2bf6
HCL2: generate hcl tags with go-cty tags too (#9306)
This will allow to generate the config files:

```go
package main

import (
	"fmt"

	"github.com/hashicorp/hcl/v2/gohcl"
	"github.com/hashicorp/hcl/v2/hclwrite"
	"github.com/hashicorp/packer/builder/alicloud/ecs"
)

func main() {
	name := "name"
	app := ecs.FlatConfig{
		AlicloudImageName: &name,
		ECSSystemDiskMapping: &ecs.FlatAlicloudDiskDevice{
			DiskName: &name,
		},
	}

	f := hclwrite.NewEmptyFile()
	block := gohcl.EncodeAsBlock(&app, `source "something" "something"`)
	f.Body().AppendBlock(block)
	fmt.Printf("%s", f.Bytes())
}

```

Will output:

```
source "something" "something" {
  packer_user_variables      = null
  packer_sensitive_variables = null
  image_name                 = "name"
  image_share_account        = null
  image_unshare_account      = null
  image_copy_regions         = null
  image_copy_names           = null
  tags                       = null
  tag                        = null
  system_disk_mapping        = { disk_category = null, disk_delete_with_instance = null, disk_descri
ption = null, disk_device = null, disk_encrypted = null, disk_name = "name", disk_size = null, disk_
snapshot_id = null }
  image_disk_mappings        = null
  ssh_remote_tunnels         = null
  ssh_local_tunnels          = null
  ssh_public_key             = null
  ssh_private_key            = null
}
```

This is a good first step for #9015 and #9282 

fix #9304
2020-05-28 11:19:00 +02:00
Adrien Delorme 0fa60c68fb
Drop the iso_checksum_type & iso_checksum_url fields (#8437)
* Drop the iso_checksum_type & iso_checksum_url fields

In favor of simply using iso_checksum that will know what to do.

* fix after master merge

* Update builder_test.go

* Update builder_test.go

* Update builder_test.go

* Update builder_test.go

* Update builder_test.go

* remove checksum lowercasing tests

* Update builder_test.go

* Update builder_test.go

* better docs

* Update builder_test.go

* even better docs

* Update config.go

* Update builder_test.go

* Update step_create_vmx_test.go

* make generate

* better docs

* fix imports

* up tests

* Update _ISOConfig-required.html.md

* Update builder_test.go

* don't use sha1.Sum("none") as a caching path

* Update builder_test.go

* better docs

* Update iso_config_test.go

remove ISOChecksumType/ISOChecksumURL references

* Update step_download_test.go

* add iso_checksum_url and iso_checksum_type fixers + tests

* add concrete examples of checksum values

* add examples of checksumming from local file

* update go-getter dep

* up deps

* use new go-getter version

* up ESX5Driver.VerifyChecksum: use go-getter's checksumming

* ISOConfig.Prepare: get checksum there in case we need it as a string in ESX5Driver.VerifyChecksum

* Update iso_config.go

* get go-getter from v2 branch

* Update driver_esx5.go

add more comments

* Update driver_esx5.go

* show better error message when the checksum is invalid

* Update builder_test.go

put in a valid checksum to fix tests, checksum is md5("packer")

* Update builder_test.go

test invalid and valid checksum

* more test updating

* fix default md5 string to be a valid md5

* TestChecksumFileNameMixedCaseBug: use 'file:' prefix for file checksumming

* Update iso_config_test.go

* Update iso_config_test.go

* Update builder_test.go

* Update builder_test.go

* Update builder_test.go

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update go.mod

* Update go.mod

* Update CHANGELOG.md
2020-05-28 11:02:09 +02:00
Joshua Foster 828440d852 rebase and run generate 2020-05-27 15:05:23 -07:00
Joshua Foster 43714049e8 add set_host_for_datastore_uploads flag 2020-05-27 15:00:08 -07:00
jhawk28 820f353573
(vsphere-iso) remove deprecated network and disk fields (#9149)
* remove deprecated network and disk fields
2020-05-19 10:06:12 -04:00
Sylvia Moss 1c30a71d09
Replace file shared state by statebag (#9238) 2020-05-19 11:49:48 +02:00
Megan Marsh 4ef34f7fba fix iso config prepare 2020-05-08 14:11:51 -07:00
Ryo Tagami fdc73376ba
floppy_label Parameter for vsphere-iso Builder (#9187)
Add ability to specify `floppy_label` parameter for `vsphere-iso`
builder, which would be especially beneficial when someone wants to pass
information to cloud-init via floppy disk images.

Signed-off-by: Ryo Tagami <rtagami@airstrip.jp>
2020-05-08 16:13:54 +02:00
Megan Marsh 7e0cfd8b77 add undocumented tag to struct-markdown generator so that we can leave internal-use-only fields out of docs 2020-05-01 10:31:38 -07:00
Megan Marsh 3f8ee2b426
add exported files to VSphere artifact (#9020)
* add exported files to VSphere artifact

* clean up grammar for vsphere template docs

* add to vsphere clone
2020-04-30 15:22:57 -04:00
Megan Marsh 30061b3def
Merge pull request #9095 from VladRassokhin/vsphere-disable-shutdown
Add disable_shutdown option to VSphere builders
2020-04-29 15:18:24 -07:00
Megan Marsh 2a560a517e
Merge pull request #8946 from thor/feature/vgpu-profiles
Add support for specifying vGPU profiles
2020-04-29 13:27:19 -07:00
Vladislav Rassokhin 03c4bebf00 Add disable_shutdown option to VSphere builders
Also don't try to shut down VM if it's already off, otherwise VSphere would raise an error: "The attempted operation cannot be performed in the current state (Powered off)."
2020-04-29 14:19:43 +03:00
jhawk28 c43a52aafe
fix issue where -force is not working with vsphere builders (#9039)
* add better error support to check if vm exists use path.Join so that it looks up the VM correctly turn off VM if it is still running

* fix the vsphere-clone also

* add a common precleanvm to the driver to dedupe iso and clone logic, reduce the if nesting
2020-04-23 08:07:07 -04:00
Thor K. Høgås ebfc5bcdcb
Merge branch 'master' into feature/vgpu-profiles 2020-04-15 12:02:37 +02:00
Vladislav Rassokhin 91a1ad63fa builder/vsphere-iso: support EFI Secure Boot using another value in `firmware` (#8873) 2020-04-14 10:28:22 -07:00
Adrien Delorme 840e67f775
HCL2: when we see a map generate an attribute spec instead of a block spec (#9035)
* mapstructure-to-hcl2: when we see a map generate an attribute spec and not a block spec

this will alow to do

tags = {
 key = "value"
}

instead of

tags {
  key = "value"
}

This will also enable using variables directly for those tags

* generate code

* update tests
2020-04-14 16:05:13 +02:00
Joshua Foster 7f0dbdebb2 clean up documentation for new NIC and storage params
adding examples, updating .gitattributes so *.mdx files have LF endings for windows
2020-04-13 14:28:50 -04:00
Thor K. H 2a40f471b7 Add vgpu_profile support for using GRID vGPUs
It hooks directly into Configure, common for both vsphere-clone and
vsphere-iso.
Note that acceptance tests are still missing.
2020-04-08 17:11:14 +02:00
Joshua Foster cf3c448d17 disk_size should not be required if storage is defined 2020-03-31 11:47:09 -04:00
Rui Lopes c387dc2c53
builder/vsphere-clone: Find the vm within the folder (#8938) 2020-03-24 11:28:00 -04:00
Wilken Rivera a7c5daf80d vsphere/iso: Add support for ovf export options
* Fix generated documentation for the additional export options field
2020-03-19 14:46:30 -04:00
jhawk28 99b0b98311
Add ovf export capability to vsphere builders (#8764)
* add ovf export capability to vsphere builders

* remove unneeded floppy ejection

* add prepare step for export. updated output directory to be the actual destination directory

* add step export documentation

* add extra export options

* add ui messages for export step

Co-authored-by: Megan Marsh <megan@hashicorp.com>
Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
2020-03-19 13:51:43 -04:00
Adrien Delorme 88297c796d Merge branch 'master' into hcl2_singular_blocks 2020-03-17 14:47:17 +01:00
Adrien Delorme 834f44190f go generate 2020-03-17 12:30:36 +01:00
Megan Marsh 6008f911fd
Merge pull request #8847 from takaishi/support-keyboard-interactive
communicator/ssh: support keyboard-interactive auth to connect bastion
2020-03-13 11:48:12 -07:00
r_takaishi f50ff1d270 make generate 2020-03-13 11:29:42 +09:00
Joshua Foster 49bd57ee12 add the remote iso first so that it is first in boot order 2020-03-12 11:29:19 -04:00
jnsc 764b4cb50a
updated link to GuestOsIdentifier (#8849)
Co-authored-by: Adrien Delorme <adrien.delorme@icloud.com>
2020-03-06 15:30:11 +01:00
Wilken Rivera 698924f246
vSphere ISO supports more common options (#8845)
The `convert_to_template` and `create_snapshot` are supported across
both builders, but currently only shown in the vSphere Clone docs, this adds
them to it.
2020-03-05 15:04:15 -05:00
Joshua Foster 1dbe5abc14 update documentation based on feedback 2020-03-04 09:48:01 -05:00
Joshua Foster d7230827cd (vsphere-iso) add ability to define multiple disks
Closes #8749
2020-03-04 09:48:01 -05:00
Anselm Eberhardt 94130b5def
add autogenerated help for disk_eagerly_scrub 2020-02-17 17:01:00 +01:00
Anselm Eberhardt 6c749eecf7
add support for eagerly zeroed / scrubbed disks 2020-02-17 16:26:07 +01:00
jhawk28 7f0de5fc8d
add ability to define multiple NICs for vsphere-iso (#8739) 2020-02-14 17:51:57 +01:00
Wilken Rivera 9ec8b67392
Add golangci-lint to project (#8686)
* Add golangci-lint as linting tool

* Disable failing staticchecks to start; GitHub issue to handle coming soon

* Run `goimports -w` to repair all source files that have improperly
formatted imports

* makefile: Add ci-lint target to run on travis

This change adds a new make target for running golangci-lint on newly
added Go files only. This target is expected to run during Packer ci builds.

* .github/contributing: Add code linting instructions

* travis: Update job configuration to run parallel builds
2020-02-14 11:42:29 -05:00
Dax T. Games 78012dc56f add autogenerated help for vsphere iso remove cdrom 2020-02-12 11:31:46 -05:00
Dax T. Games 1cb6f4e456 Merge branch 'vsphere_iso_remove_cdrom' of https://github.com/daxgames/packer into vsphere_iso_remove_cdrom
* 'vsphere_iso_remove_cdrom' of https://github.com/daxgames/packer:
  format
  Update builder.go
2020-02-05 11:11:43 -05:00
Dax T. Games 76680ac1c6 add docs 2020-02-05 11:10:50 -05:00
Dax T. Games 6b82bf5a93 format 2020-02-05 15:25:49 +00:00
Dax T Games 9756a9858a
Update builder.go 2020-02-04 14:41:44 -05:00
Dax T. Games 4fa0f6baa3 recreate https://github.com/jetbrains-infra/packer-builder-vsphere/pull/238 2020-02-04 14:25:45 -05:00
Megan Marsh d252a24b82 allow user to set winrm_host override like we do ssh_host override 2020-01-30 15:22:22 -08:00
Sylvia Moss dc31bad539
Sharing info with post-processors via artifact (#8632) 2020-01-30 11:27:58 +01:00
Megan Marsh 82f03fca7c fix to work with hcl2; update tests 2020-01-13 15:52:05 -08:00
Megan Marsh dfb45e86cc remove unused file, set up prepare() properly to work with HCL2 in vsphere-clone builder 2020-01-13 12:33:56 -08:00
Megan Marsh 9459e2233b fix config loading to work with HCL2 2020-01-13 11:51:36 -08:00
Megan Marsh f84634aff3 small log line improvements 2020-01-13 11:43:53 -08:00