1391 Commits

Author SHA1 Message Date
Megan Marsh
a8d3e9c5a8 add progress tracker to vmware-esx iso upload. Add colored prefix to … (#9779)
* add progress tracker to vmware-esx iso upload. Add colored prefix to tracker to make it clear which build a tracker belongs to.

* fix mock; fix tests
2020-08-17 14:35:42 -04:00
Megan Marsh
9bdf23a43a add network_name option to vmware builder to make it match the network option on the vsphere builder, so vmware users needn't update vmx data just for the network name (#9718) 2020-08-06 13:19:55 +02:00
Megan Marsh
8f8b0a9c79 improve postprocessor stdout 2020-07-25 08:24:21 -07:00
Megan Marsh
55cb243cad Merge pull request #9589 from hashicorp/fix_9184
post-processor/vsphere: Fix password encoding in vsphere post-processor ovftool call
2020-07-25 08:23:54 -07:00
Adrien Delorme
cc2e8e2250 refactor initialization out from packer configs + tests (#9627)
The initialization of packer core in JSON also validates that `null` variables were set, except in the case of `packer validate --syntax-only` , but after the refactor to allow to have all commands work with HCL2 and JSON this subtlety was lost.

This refactors the initialisation of the core in order to allow to have `packer validate --syntax-only` not error in case a variable is not set. Since these calls are refactored this works for HCL2 too.

fix #9478
2020-07-24 10:58:03 +02:00
Megan Marsh
9d08666c45 apply same url encoding to other places we call ovftool 2020-07-23 17:03:42 -07:00
Megan Marsh
b8d2b8d3b1 communicator/ssh: Add new option to supply custom key exchange algorithms in SSH client (#9634)
* add kex algorithm option to ssh config

* regenerate code
2020-07-23 09:41:31 +02:00
Megan Marsh
c6c48321e4 ci/tech-debt: Fix vmware acceptance tests (#9636)
* add kex algorithm option to ssh config

* regenerate code

* This commit fixes old vmware acceptance tests that have not been run in some time. It does this in two parts:
1) It modifies the minimal vmware build configuration to use a custom kex algorithm, which enables the ssh connection to succeed.
2) It modifies logic in reading and defaulting hardware config values, which was crashing.
3) It adds a new acceptance test with a preseed file to test loading from an http directory.
2020-07-23 09:40:57 +02:00
Megan Marsh
5806ca6e9c Merge pull request #9565 from mk0x9/docker/builder-add-runner-params
builder/docker: runner support for --cap-add, --cap-drop, --tmpfs, --device
2020-07-15 10:16:13 -07:00
Adrien Delorme
67be057e7e esx5driver.VerifyChecksum: try checksum remote file instead of local file
fix #9456
2020-07-15 18:21:08 +02:00
Michael Kuryshev
c82bc4a147 builder/docker: reference to docker docs regarding capabilities 2020-07-15 03:04:13 +02:00
Michael Kuryshev
fbd8c7be2c builder/docker: runner support for --device 2020-07-14 10:37:44 -07:00
Michael Kuryshev
e4c8066207 builder/docker: runner support for --cap-add, --cap-drop, --tmpfs 2020-07-14 10:34:10 -07:00
Jonathan Neal
04731bb3f0 📌 Hard Pin Website Dependencies (#9543)
* Update and pin dependencies
* Update NextJS Scripts
* npm run lint
* npm run format
* docs generator: indent docs by two and make spacing better

Co-authored-by: Adrien Delorme <azr@users.noreply.github.com>
2020-07-13 12:33:16 +02:00
Megan Marsh
41c1ef3f9a Merge pull request #9521 from rogerhu/ssh_ed2559
adding basic support for OpenSSH certificate signing
2020-07-12 09:51:32 -07:00
Roger Hu
37dcf118b7 update generated files 2020-07-10 16:58:06 -07:00
Moss
edc9b684bf undocument ssh_keypair_name and ssh_agent_auth 2020-07-02 14:55:58 +02:00
Moss
33b24d0fb1 undocument temporary_key_pair_name and ssh_private_key_file 2020-07-01 16:33:18 +02:00
Megan Marsh
20e45f2eba add new ssh_ciphers option 2020-06-17 16:48:23 -07:00
Megan Marsh
e281a30fad Merge pull request #9267 from hashicorp/fix_7224
re-add the no_proxy option to bypass environment proxy.
2020-06-16 11:30:38 -07:00
Megan Marsh
b4b1ccf2a6 re-add winrm_no_proxy option. Winrm code needs to be modified in order to read no_proxy env var when client is created rather than when net/http library is instantiated. 2020-06-16 10:27:30 -07:00
Adrien Delorme
7a5a437180 add basic HCL2 docs for vmware 2020-06-16 17:03:15 +02:00
Ali Rizvi-Santiago
0ca66df2de Fixed a race in the ReadNetworkingConfig implementation from the parsers belonging to the vmware builders that existed between reading the version and consuming tokens from the rest of the file. 2020-06-09 19:37:38 -05:00
Megan Marsh
f6e4309827 fix test 2020-06-05 14:05:59 -07:00
Megan Marsh
b2d2fae8bd Merge pull request #9322 from arizvisa/GH-8528
Fix the VMware builders when the guest platform's dhcpcd switches the ip address in-between a build
2020-06-05 10:58:00 -07:00
Ali Rizvi-Santiago
9d98ffd674 Re-added the (mistakenly removed) host override to the CommHost for the vmware builders. 2020-06-05 12:39:20 -05:00
Megan Marsh
3af592d265 add ssh override test 2020-06-05 10:15:11 -07:00
Ali Rizvi-Santiago
e217fac3c1 Added @SwampDragons' suggestion to the CommHost() implementation for the vmware builders which uses the communicator config's Config.Port() function to determine the communication port-number independent of the configured protocol. 2020-06-04 19:04:12 -05:00
Megan Marsh
c008d8c961 Merge pull request #9319 from arizvisa/GH-8528.refactor
This refactors the dhcpd lease parser in the vmware builders and adds unit tests for everything.
2020-06-04 12:18:49 -07:00
Ali Rizvi-Santiago
3aaa9a0871 Added suggestions from @SwampDragons to the parsers from the vmware builders, included unit-tests and sample file for fusion's networking file, and fixed a few situations where the channel wasn't being closed. 2020-06-04 05:07:18 -05:00
Megan Marsh
9235279a6b Merge pull request #9313 from jhawk28/http_bind_address
add the ability to configure the http bind address
2020-06-03 16:56:43 -07:00
Joshua Foster
d6200f2b7e add the ability to configure the http bind address. defaults to 0.0.0.0. 2020-06-03 16:40:18 -07:00
Megan Marsh
71e23e1239 Merge pull request #9303 from arizvisa/GH-8528.unit-tests
Unit tests for the driver_parser.go functionality of the vmware builder
2020-06-02 15:28:13 -07:00
Ali Rizvi-Santiago
90f7ac7ea5 Didn't know that WinRM uses a different variable for the port number when trying to determine the communication host in CommHost...now it's fixed. 2020-05-30 02:17:21 -05:00
Ali Rizvi-Santiago
ee83615e0d Re-worked the vmware builder drivers so that they're able to check multiple ip addresses when trying to connect via the CommHost. 2020-05-28 15:36:45 -05:00
Ali Rizvi-Santiago
41f3714d77 Fixed some lint issues. 2020-05-28 13:53:49 -05:00
Ali Rizvi-Santiago
43e94515b2 Rewrote the GuestIP implementation in the vmware builder to use the new dhcpd lease parsers instead of the old regexp-based logic. 2020-05-28 13:22:58 -05:00
Ali Rizvi-Santiago
bc93f635b9 Finished implementing the final dhcpd lease entries parser for the vmware builders and also included its own unit tests. 2020-05-28 13:22:58 -05:00
Ali Rizvi-Santiago
5270dde3f2 Updated the dhcpd lease entry parser in the vmware builder to return errors if any are encountered. 2020-05-28 13:22:58 -05:00
Ali Rizvi-Santiago
4bf1b664c4 Tightened the regular expressions used by the vmware builder to parse the dhcpd leases, and added support for parsing the weekdays. 2020-05-28 13:22:58 -05:00
Ali Rizvi-Santiago
80cb494734 Implemented the dhcpd lease entry decoder and the address decoder for the vmware builder. 2020-05-28 13:22:57 -05:00
Ali Rizvi-Santiago
db90647393 Added a number of parsing combinators to the vmware builder and some minor tests for them to help with parsing dhcpd leases. 2020-05-28 13:22:57 -05:00
Ali Rizvi-Santiago
d72e083f6f Removed the sentinelSignaller chan from the vmware builder parsers and its unit-tests, and also commented all of the goroutines that are used. 2020-05-28 13:22:56 -05:00
Ali Rizvi-Santiago
a55fb4010e More lint issues fixed... 2020-05-28 13:12:42 -05:00
Ali Rizvi-Santiago
3115d4ba8f Fixed some lint issues in the unit tests for the vmware builder driver parsers. 2020-05-28 13:07:54 -05:00
Adrien Delorme
9ddf2c4704 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
9be20a4eed 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
Ali Rizvi-Santiago
a247f19b4e Added unit-tests for the netmap parsing components in the vmware builder. 2020-05-26 23:03:30 -05:00
Ali Rizvi-Santiago
03e399d6da Added unit-tests for the dhcpd configuration components in the vmware builder, and fixed a few discovered race conditions. 2020-05-26 22:59:35 -05:00
Sylvia Moss
050e8b5dd1 Replace file shared state by statebag (#9238) 2020-05-19 11:49:48 +02:00