16428 Commits

Author SHA1 Message Date
Adrien Delorme
d919fc28ab add doc 2020-11-02 17:20:46 +01:00
Adrien Delorme
88175873e5 fix tests to actually check cty values & types 2020-11-02 17:03:38 +01:00
Adrien Delorme
6dd06fad14 add command/ tests 2020-11-02 15:50:38 +01:00
Adrien Delorme
6911495fc4 add VariableAssignment struct that help describe an input var assignment 2020-11-02 15:22:29 +01:00
Adrien Delorme
8de2f40a07 add tests for length 2020-10-30 15:42:59 +01:00
Adrien Delorme
b892414e84 add failing test case 2020-10-30 15:40:31 +01:00
Adrien Delorme
9932fd1217 add Variable.validateValue func 2020-10-30 15:38:29 +01:00
Adrien Delorme
4d386dd806 add length function that can work with more types 2020-10-30 15:36:23 +01:00
Adrien Delorme
4e08ea6a92 add a test 2020-10-30 12:41:29 +01:00
Adrien Delorme
91d7332471 add basic code for variable validation parsing
* hcl2template/addrs.ParseRef will parse a reference and tell for example if we
  are referring to a variable and its name, for now it can only do that and in
  the future it improved when we need to most of it is from the TF code. This
  is used to tell wether a variable vas referenced in a variable validation
  condition; for now.
* Added Validations blocks to the hcl2 Variable struct and code to
  parse/validate that.
2020-10-30 12:26:22 +01:00
Megan Marsh
69312458c4
Merge pull request #10111 from hashicorp/azr_selectable_temp_keygen_type_gcp
GCP: Allow to select algo when generating temporary SSH keypair
2020-10-28 11:25:50 -07:00
Megan Marsh
fb3d357e84
fix step_shutdown when a null communicator is used (#10178) 2020-10-28 11:14:03 +01:00
Megan Marsh
8f3a115c5a
Merge pull request #10173 from hashicorp/azr-fix-hcl2-gcp-image_encryption_key
Fix GCP HCL image_encryption_key fields and use the same casing in JSON and HCL2
2020-10-27 10:56:26 -07:00
Megan Marsh
dc38fadeeb
Merge pull request #10155 from hashicorp/logging_for_10042
builder/vsphere: Don't try to delete a cd file from the remote datastore if the upload of the cd failed
2020-10-27 10:54:07 -07:00
Megan Marsh
8adbba6904 switch to guard clause format 2020-10-27 10:37:03 -07:00
Adrien Delorme
ef32147a4a Fix GCP HCL image_encryption_key fields and use the same casing in JSON and HCL2
this closes #9997
2020-10-27 15:46:45 +01:00
Megan Marsh
c4866504e1
respect the destroy flag in content library config (#10165)
* respect the destroy flag in content library config

* Make vsphere-clone respect delete_vm state tag; use a common delete func to prevent future drift
2020-10-27 09:07:08 -04:00
Adrien Delorme
4bc16455b4
HCL2: add a packer block with a required_version input setting (#10149)
* add the possibility to set the packer.required_version field; to make sure the template file works with that version of Packer
* add tests
* add documentation on packer.required_version

Example:

packer {
  required_version = ">= 1.2.0, < 2.0.0"
}
2020-10-27 10:03:36 +01:00
Wilken Rivera
73e842fab6 update CHANGELOG 2020-10-26 14:00:17 -04:00
Adrien Delorme
bab29060fe regen hcl after master merge 2020-10-26 15:48:10 +01:00
Adrien Delorme
f5e037e8b4 Merge remote-tracking branch 'origin/master' into azr_selectable_temp_keygen_type_gcp 2020-10-26 15:47:29 +01:00
Adrien Delorme
b4f68767a3 make default key type RSA instead of DSA 2020-10-26 15:45:06 +01:00
blz-ea
73370570f4
Fix Proxmox builder unhandled buildvar type (#10154)
* Fix Proxmox builder unhandled buildvar type #10139

Co-authored-by: Calle Pettersson <carlpett@users.noreply.github.com>
Co-authored-by: Adrien Delorme <adrien.delorme@icloud.com>
2020-10-26 15:11:09 +01:00
Megan Marsh
25f4e24772
Merge pull request #10150 from nshalman/nshalman/tag-snapshots
amazon/ebssurrogate: apply snapshot tags right when taking snapshot
2020-10-23 15:57:18 -07:00
Megan Marsh
7646ecf8c6 fix tests 2020-10-23 15:35:37 -07:00
Megan Marsh
8821114e97
Merge pull request #10162 from hashicorp/td-makefile-test-targets
makefile: Disable test caching explicitly for go test
2020-10-23 15:22:20 -07:00
Megan Marsh
4862b2c0f0
Merge pull request #10163 from hashicorp/fix-azure_arm-manageddisk-deletion-regression
builder/azure_arm: Fix build failures due to the deletion of attached managed disks
2020-10-23 15:19:30 -07:00
Wilken Rivera
791a69e78f
Merge pull request #10166 from hashicorp/fix_master
fix fixer deprecated options conflict
2020-10-23 17:09:16 -04:00
Megan Marsh
645eff58d1 fix fixer deprecated options conflict 2020-10-23 14:00:12 -07:00
Megan Marsh
fc619dc977
Merge pull request #9626 from featheredtoast/add-proxmox-vm-clone
builder/proxmox FEATURE: split Proxmox into proxmox-iso and proxmox-clone
2020-10-23 13:36:45 -07:00
Megan Marsh
b6424354c3
Merge pull request #9964 from netapp-jgriffit/hashicorp/packer#9924
Hashicorp/packer#9924
2020-10-23 12:44:55 -07:00
Megan Marsh
56c7a9cda5 rebase 2020-10-23 11:47:20 -07:00
netapp-jgriffit
15467aa868 Update builder/vsphere/common/step_shutdown.go
Co-authored-by: Sylvia Moss <sylviamoss.m@gmail.com>
2020-10-23 11:41:03 -07:00
James Griffith
185f3d9d48 vsphere clone config not yet using warnings, leaving code commented out 2020-10-23 11:41:03 -07:00
James Griffith
c8ad66f419 update to docs as suggested 2020-10-23 11:41:03 -07:00
James Griffith
c86a48fbc9 syntax change 2020-10-23 11:41:03 -07:00
James Griffith
f86f7c4464 Another instance using Prepare() needed an update 2020-10-23 11:41:03 -07:00
James Griffith
09edada93d moved the warning into Prepare() and updated the invocation 2020-10-23 11:41:03 -07:00
James Griffith
572de129d7 update documentation 2020-10-23 11:41:03 -07:00
James Griffith
1048cdbcc4 check for no communicator and provide messaging to user 2020-10-23 11:41:03 -07:00
James Griffith
2ecf5cc9aa Communicator is not needed unless shutdown_command is populated 2020-10-23 11:41:03 -07:00
James Griffith
6b39b1eed6 StepShutdown should still occur if Comm.Type is none 2020-10-23 11:41:03 -07:00
James Griffith
65ff092fd4 hashicorp/packer#9924 2020-10-23 11:41:03 -07:00
Megan Marsh
19bd997f11 add directory existence check 2020-10-23 11:06:25 -07:00
Wilken Rivera
a1d69bfe91 Fix liniting issues 2020-10-23 13:52:05 -04:00
Wilken Rivera
afd33679f5 builder/azure_arm: Fix build failures due to the deletion of attached managed disks
Previously (prior to v1.6.2) the Azure ARM builder had two delete functions
one that would run before any of the StepDelete* types, and one on deployment template
cleanup. The refactored coded re-introduces the logic from the previously removed
step in v1.6.1 as the main delete logic for the whole deployment
template. Ensuring that all deployed items are deleted before trying to
remove any managed disks.

This change moves all the deletion logic into the
step_deployment_template#Cleanup function to ensure that dependent steps
are only called once the created deployment items (i.e
StepDelateAdditionalDisks) have been deleted.

Test results before change
```

    compute.DisksClient#Delete: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="OperationNotAllowed" Message="Disk pkrdd02e9rzzu5k-1 is attached to VM /subscriptions/1f90521a-24f6-4758-ac3d-88d869fb0bf5/resourceGroups/packer-acceptance-test/providers/Microsoft.Compute/virtualMachines/pkrvm02e9rzzu5k."
--- FAIL: TestBuilderAcc_ManagedDisk_Windows_Build_Resource_Group_Additional_Disk (454.00s)
FAIL
FAIL    github.com/hashicorp/packer/builder/azure/arm   454.008s

```

Test results after change
```
--- PASS: TestBuilderAcc_ManagedDisk_Windows_Build_Resource_Group_Additional_Disk (563.56s)

```

Closes #10070
2020-10-23 13:44:27 -04:00
Wilken Rivera
26161b7599 makefile: Disable test caching explicitly for go test
* Bump the default time for acceptance tests to 120m
2020-10-23 13:41:14 -04:00
Megan Marsh
8f67f939f9
Merge pull request #10158 from Direnol/yandex-add-support-iam-auth
Added support for IAM credential in the token field and YC_TOKEN env
2020-10-23 09:39:46 -07:00
Roman Mingazeev
75befba67e add more doc 2020-10-23 18:01:52 +03:00
Roman Mingazeev
09add100f2 fix doc generate 2020-10-23 14:36:00 +03:00