658 Commits

Author SHA1 Message Date
Megan Marsh
f52a2ad0fa move retry function that is only used by osc builder into that builder's common dir instead of the global common dir. Fix bug in quemu where the wrong retry value is checked against. 2020-11-13 15:24:58 -08:00
Megan Marsh
fa233a6a56 remove unused code leftover from original progress bar implementation 2020-11-13 15:24:58 -08:00
Megan Marsh
c4d0c5505a fix tests
regenerate code
regenerate code, revendor
fix website
2020-11-13 15:00:12 -08:00
Megan Marsh
e04eaa89e6 move steps and step configs from packer/common to packer/common/commonsteps 2020-11-13 11:15:04 -08:00
Megan Marsh
6402362018 create packer-plugin-sdk directory and begin moving the relevant folders into it. 2020-11-13 10:47:36 -08:00
Megan Marsh
8ecd16db81 regenerate code 2020-11-10 08:16:59 -08:00
Megan Marsh
cd59d938b2 refactor core version pkg imports out of json interpolation/decode pathway. 2020-11-09 13:20:36 -08:00
Megan Marsh
bc85854a53 refactor packer version out of hcltemplate code. 2020-11-09 12:29:53 -08:00
Megan Marsh
cd74456026
Common provisioner helpers (#10229)
* update docstrings to make it clear that plugins are servers and core is client

* move provisioner guest helper functions into common dir.
2020-11-09 12:16:44 +01:00
Megan Marsh
2d90ffe7a4 move GeneratedData struct and PlaceholderMsg to same package under common 2020-11-06 10:45:38 -08:00
Megan Marsh
45b5f0c2ee move custom http client creation with env proxy args into same package as other network related helpers 2020-11-04 14:51:14 -08:00
Megan Marsh
7b57e28600 move localexec to common/shell-local dir since it is related to shelling out locally 2020-11-04 11:56:46 -08:00
Megan Marsh
d8fec2e9e5
move the hyperv-only powershell dependency into the hyperv subdirectory (#10198) 2020-11-04 15:15:43 +01:00
Megan Marsh
c4001734d0
Merge pull request #10143 from hashicorp/do_9951
builder/vsphere: skip iso download if hashed file is already present on remote datastore
2020-10-22 15:06:04 -07:00
Megan Marsh
796c40f89b builder/vsphere: skip iso download if hashed file is already present in remote packer_cache 2020-10-21 11:33:43 -07:00
Adrien Delorme
6d4fae0f2d
Add HCL2 aws_secretsmanager function (#10124)
* refactor aws get secrets function out to reuse it else where
* add aws_secretsmanager func and docs for HCL2
* fix GetSecret: allow to pick secret version
2020-10-20 16:21:40 +02:00
Megan Marsh
cc7dbf6092
Add consul_key function to integrate concul with hcl2 tempaltes. (#10119)
* Add consul_key function to integrate concul with hcl2 tempaltes.
* sidebar nav
2020-10-19 14:07:13 +02:00
Megan Marsh
b105e5e416
Update common/step_create_cdrom.go
Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
2020-10-02 09:17:29 -07:00
Megan Marsh
69fd5a1527 fix pathing in cd_files copy to make sure directories make it into the cd root. 2020-09-30 15:15:55 -07:00
Megan Marsh
09cdc4275b
Merge pull request #9974 from hashicorp/fix_9786
Switch to explicitly declaring TrackProgress on UI, using an underlyi…
2020-09-24 11:04:23 -07:00
Megan Marsh
a805bc538e fix tests 2020-09-21 16:23:00 -07:00
Rui Lopes
13be37ee44 add support for running cygwin/msys2 based cd/iso creation tool (e.g. xorriso) 2020-09-17 07:25:00 +01:00
Megan Marsh
96e17b84bf fix lost command part 2020-09-14 12:42:11 -07:00
Andreas Botzner
3739970b84
Adds ability to specify interfaces for http_directroy and VM for the Proxmox builder (#9874)
Adds two config options to the Proxmox builder:
```
http_interface
vm_interface
```
Both give the user the ability to specify an interface whos IP will be set as the `.HTTPIP` and VMIP respectively.

This is useful when the VM and or the machine executing Packer has multiple interfaces.
Until now Packer would accept the first non-loopback IP as the `.HTTPIP` and VMIP.

I'm open to suggestions and any kind of feedback. 


* Added ability to define the NIC where the HTTPIP is taken from.
* Added VM interface config option
* fmt and documentation
* Moved HTTPInterface into HTTPCommon
* Build Fix
* Documentation Fix
2020-09-14 12:24:01 +02:00
Rui Lopes
53331644a6
add support for using xorriso to create the cdrom iso (#9919) 2020-09-11 14:11:19 -04:00
Megan Marsh
988ab66731
Update common/extra_iso_config.go
thanks for the copyediting :D

Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
2020-09-08 11:18:10 -07:00
Megan Marsh
d2dd158fe2 Implement cd_files option. The Addfile code is modified from the floppy_files
tooling. Tested on OSX, `Windows, and Linux. Documented command line dependencies.
Added acceptance tests (behind testacc flag, since there are dependencies).
This option is only implemented for the vmware and hyperv iso builders. It will be
implemented for others in later PRs in order to make review easier.
2020-09-04 12:20:19 -07:00
jsmcnair
78c280b1b7 Use common funcs / fix panic / clarify docs 2020-08-12 22:34:13 +01:00
Megan Marsh
f8bb9008c0
Merge pull request #9697 from backerman/personal/backerman/9695
Add FreeBSD support to azure/chroot
2020-08-10 12:47:48 -07:00
Brad Ackerman
c43d99ccfd
Add tests for StepCopyFiles. 2020-08-09 15:44:50 -07:00
Sylvia Moss
dcacf7ad4c
Add vSphere HCL examples to the docs (#9674) 2020-08-05 19:23:52 +02:00
Brad Ackerman
364c415294
Add FreeBSD support. 2020-08-01 21:22:50 -07:00
Artem Zavatskiy
c0048daed5 fix agent auth in ssh communicator for ansible provisioner (#9488) 2020-07-23 16:03:01 +03:00
Adrien Delorme
125178d943
core: Decode: when in HCL2 decoding mode; reset the whole struct before preparing it. (#9622)
* core: Decode when in HCL2 decoding mode; reset the whole struct before preparing it.
* HCL2: add path variables + docs & tests

Co-authored-by: Megan Marsh <megan@hashicorp.com>
2020-07-23 09:25:07 +02:00
Stephan Wild
061dbecd61 Include Hyper-V secure boot template in box.xml 2020-07-08 18:23:19 +02:00
Moss
4f26534072 add on-error flag option to run cleanup provisioner 2020-06-16 15:34:00 +02:00
Moss
2d79ab732b adds missing special char to the list 2020-06-12 15:17:41 +02:00
Moss
653eb95bdb adds tests to usb_driver and step_http_ip_discover 2020-06-12 14:51:52 +02:00
Moss
65cfb880fd Fix boot_command and update docs 2020-06-12 14:51:52 +02:00
Moss
ba767d1663 remove duplicated press 2020-06-12 14:51:52 +02:00
Moss
585a86fe03 Add usb_driver to common boot_command and use it on vsphere 2020-06-12 14:51:52 +02:00
Sylvia Moss
aa52e690ee
Update go-getter and add samba shared files tests to step_download (#8954) 2020-06-04 15:00:18 +02:00
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
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
Sylvia Moss
1c30a71d09
Replace file shared state by statebag (#9238) 2020-05-19 11:49:48 +02:00
Sylvia Moss
25971b3b5c
Add pwd to gogetter ChecksumFromFile (#9129) 2020-05-11 11:14:50 +02:00
Rui Lopes
86ac132056
hyperv: add support for setting the boot order (#9046) 2020-04-30 13:31:41 +02: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
Megan Marsh
6fc3c4eb49 properly document how to set boot_wait to 0s 2020-04-07 16:43:33 -07:00