Commit Graph

15233 Commits

Author SHA1 Message Date
Megan Marsh 9ee75bc41c add disk_size, disk_thin_provisioned, and disk_eagerly_scrub to the DeprecatedOptions field. 2020-05-29 09:45:36 -07:00
Megan Marsh 865d8f04eb remove outdated comment 2020-05-29 09:43:31 -07:00
Megan Marsh 9842e02aab Update fix/fixer_amazon_temporary_security_group_cidrs.go
Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
2020-05-29 09:40:31 -07:00
Megan Marsh 7c2dfd2760 appease linter 2020-05-29 09:40:31 -07:00
Megan Marsh a94e147865 fix go fmt 2020-05-29 09:40:31 -07:00
Megan Marsh 21e9bef202 update fixer interface to return a list of deprecated options, if any 2020-05-29 09:40:31 -07:00
Megan Marsh b28059c0a5 add generator to create a list of all the deprecated options that the fixers fix
fix location of deprecated_options code
2020-05-29 09:40:31 -07:00
Megan Marsh 15b14d4879 add deprecation check to config helper 2020-05-29 09:40:31 -07:00
Wilken Rivera 37df64873f
Merge pull request #9320 from hashicorp/fix_checksum_fixer
actually run the fixer
2020-05-29 11:38:00 -04:00
Paul Meyer 93d4d63121
Update CHANGELOG.md 2020-05-28 21:15:17 -07:00
Paul Meyer 185d98045b
Merge pull request #9293 from feiyushi/identity
Support User Assigned Managed Identity in Azure
2020-05-28 21:13:41 -07:00
Feiyu Shi 1c1991c073 fix a bug 2020-05-28 19:17:22 -07:00
Feiyu Shi f86f5b958a Merge remote-tracking branch 'origin/master' into identity 2020-05-28 19:03:44 -07:00
Megan Marsh 03b2c4355e include Wilken's suggestion 2020-05-28 16:46:33 -07:00
Megan Marsh ddf223b56b fix fixer 2020-05-28 16:41:00 -07:00
Megan Marsh 1edc931e7f actually run the fixer 2020-05-28 13:14:45 -07:00
Megan Marsh 193395d734
Merge pull request #9318 from hashicorp/fix_build_prepare_failure_handling
move this to after the prepare() is successful so that we don't try t…
2020-05-28 12:29:46 -07:00
Megan Marsh 45be673c0f move this to after the prepare() is successful so that we don't try to run builds that didn't prepare successfully. 2020-05-28 11:34:00 -07:00
Ali Rizvi-Santiago 159ea595df More lint issues fixed... 2020-05-28 13:12:42 -05:00
Ali Rizvi-Santiago 32b64e0576 Fixed some lint issues in the unit tests for the vmware builder driver parsers. 2020-05-28 13:07:54 -05:00
Baptiste Lafontaine 553d2a7d0b
The prefix for local is "local." (and not ".local") (#9317) 2020-05-28 17:21:49 +02:00
Adrien Delorme 324367b808 Update variable.mdx 2020-05-28 17:09:57 +02:00
Adrien Delorme 059a782b0e remove debug log 2020-05-28 17:07:11 +02:00
Adrien Delorme 95d37ffc06 add headers 2020-05-28 17:04:34 +02:00
Adrien Delorme 12c168b2d1 better docs 2020-05-28 16:49:54 +02:00
Adrien Delorme 8a13dd3073 HCL2: Make the `build`.`sources` argument list optional 2020-05-28 16:38:41 +02:00
Adrien Delorme beceb90844 better docs 2020-05-28 16:22:07 +02:00
Adrien Delorme 11104af3a2 website/pages/docs/from-1.5/blocks/build/index.mdx: better docs arround source(s) 2020-05-28 16:16:59 +02:00
Megan Marsh 3ad2f86cc2
fix network card fixer (#9311) 2020-05-28 11:30:21 +02: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
Adrien Delorme b805a01e1a
Update website/pages/docs/from-1.5/blocks/build/provisioner.mdx
Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
2020-05-28 10:45:24 +02:00
Megan Marsh 3dc4ba2d68
Json vs HCL2 parity refactor (#9301)
* refactor so that json and hcl2 templates are both prepared in the same place in the build call, to make code easier to reason about. Remove overly verbose error output which isn't useful in vast majority of cases

* fix tests

* check err msg

* hcl2template.PackerConfig.GetBuilds: raise a diagnostic in case the packer core build perpare call errors

Co-authored-by: Adrien Delorme <adrien.delorme@icloud.com>
2020-05-28 10:43:58 +02:00
Megan Marsh d3859cf592
Merge pull request #9305 from hashicorp/azr-docs-fix-guide
HCL2: Update guide example to fix broken example
2020-05-27 16:04:31 -07:00
Megan Marsh 7b9a33d385
Merge pull request #9100 from jhawk28/bug_9076
dont set the host for the datastore upload
2020-05-27 15:39:09 -07: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
Joshua Foster 9895f90451 dont set the host for the datastore upload 2020-05-27 15:00:08 -07:00
Adrien Delorme 851b354ac9 more fixes 2020-05-27 16:51:44 +02:00
Adrien Delorme 4d8a5e1c72
Update from-json-v1.mdx 2020-05-27 16:40:47 +02:00
Ali Rizvi-Santiago 2a8bc45bc4 Added unit-tests for the netmap parsing components in the vmware builder. 2020-05-26 23:03:30 -05:00
Ali Rizvi-Santiago 7c1ad4adcf 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
Feiyu Shi 4b56635c79 Revert "import github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi"
This reverts commit 430fac1a2b.
2020-05-26 17:17:59 -07:00
Feiyu Shi fdb0b2ab03 Revert "validate if user assigned identity exists"
This reverts commit 9bd19df040.
2020-05-26 17:17:48 -07:00
Feiyu Shi 13a49f4655 Revert "fix go.mod/go.sum"
This reverts commit 79ac5bb4a4.
2020-05-26 17:17:00 -07:00
Feiyu Shi c016f3752a upgrade SIG source api-version to match identity api-version to avoid potential setback for identity 2020-05-26 16:08:00 -07:00
Megan Marsh 077d34f12c
Merge pull request #9279 from gamethis/fix_arg_order
[WIP] Anisble-Remote fix arg order
2020-05-26 16:03:31 -07:00
Megan Marsh 01839e272e
Merge pull request #9277 from nitrocode/add-source-ami-creation-date
Added SourceAMICreationDate
2020-05-26 12:24:47 -07:00
nitrocode 6d29ec956b Added SourceAMICreationDate 2020-05-26 15:04:03 -04:00
Wilken Rivera 230fa34909
Merge pull request #9273 from hashicorp/fix_secretsmanager_tests
un-bypass secretsmanager tests
2020-05-26 12:37:45 -04:00