Commit Graph

642 Commits

Author SHA1 Message Date
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
Jeff Escalante 9165be87da
packer.io prefix removal, html extension remove for in-code errors 2020-04-07 17:53:22 -04:00
Jeff Escalante 4afd107eeb
patch source files for extensions changes 2020-04-07 17:50:51 -04:00
Megan Marsh ca5814ab74 move proxy behind feature flag 2020-04-01 11:31:48 -07:00
Megan Marsh 65b64d04d0 remove docs about windows symlinks which are now inaccurage 2020-03-26 15:51:51 -07:00
Sylvia Moss e6368b9246
Fix azure winrm_password attribution and allow to set winrm_username (#8928) 2020-03-24 14:43:24 +01:00
Sylvia Moss 2319521aa5
Add iso config test for checksum from file specific case (#8897) 2020-03-18 11:32:51 +01:00
Wilken Rivera 7b705545d9
docs: Various doc clean-ups to fix code block formatting and syntax highlighting (#8868) 2020-03-12 15:05:08 +01:00
Sylvia Moss 76f13deaf4
Make template variables SSHPublicKey and SSHPrivateKey as strings (#8829) 2020-03-09 17:25:05 +01:00
Wilken Rivera e1a46ec293
Fix gosimple S1025 linting errors (#8838)
Remove unneeded use of fmt.Sprintf for variables that are already strings.
2020-03-04 15:31:30 -05:00
Lars Lehtonen f808d1d968
common/powershell: fix dropped error 2020-03-02 14:45:22 -08:00
Megan Marsh 9c9826ee4b
Merge pull request #8714 from williamb1024/hyperv-gen1-boot-order
WIP: Add Hyper-V builder `first_boot_device` setting to allow the selection of the initial device or device class used for booting the VM.
2020-03-02 12:27:25 -08:00
Ben Brown 0936f8bc03 Fix Hyper-V compacted disk size comparison
Prior to this the code compares the length of the path, which of course
doesn't change.
2020-03-02 09:55:13 +00:00
Megan Marsh 66a1cdb8d2 regenerate boot command code 2020-02-28 09:50:50 -08:00
William Brooks 7f38ce0686 test and correct gen2 SetFirstBootDeviceGen2 scripts 2020-02-21 11:09:49 -06:00
William Brooks dd8f4370c6 initial support for gen2 and fix driver_mock 2020-02-21 01:30:59 -06:00
William Brooks 5e1e4ec701 fmt && generate 2020-02-21 01:07:58 -06:00