Commit Graph

4149 Commits

Author SHA1 Message Date
Megan Marsh 196028a7ed
Merge pull request #7444 from hashicorp/docker_windows
Docker windows
2019-04-04 09:30:43 -07:00
Paul Meyer 7fc8901d8f
Merge pull request #7464 from paulmey/fix-snapshots
[azure] Fix: Power off before taking snapshot (windows)
2019-04-03 16:38:04 -07:00
Adrien Delorme c4f3dccc14 rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
Adrien Delorme a4bf94dd3c change Builder to be passed a context for cancellation
we have to to give it to our hook
2019-04-03 15:55:55 +02:00
Adrien Delorme 9836dad0c9 introduce the clean_resource_name to clean image names and deprecate the old ones 2019-04-03 11:25:51 +02:00
Megan Marsh 17c14770a7
Merge pull request #7450 from AkshatM/rename_security_group_cidr_to_security_group_cidrs
Rename and change `temporary_security_group_source_cidr`  to accept a list of strings (for Amazon builders).
2019-04-02 10:54:31 -07:00
Paul Meyer eb274c4e87 Power off before shapshotting 2019-04-01 18:40:50 +00:00
Megan Marsh 874a4ff8c7
Merge pull request #7451 from bh9/master
Allow both ports and networks in openstack builder
2019-04-01 09:30:39 -07:00
Adrien Delorme 225f4bab1f
Merge pull request #7446 from hashicorp/do_6928
remove default ssh_username from oracle classic builder, but add note…
2019-04-01 17:24:36 +02:00
bh9 cbbbc451b5
Allow both ports and networks in openstack builder
Current code would throw an index out of range exception when trying to access `s.Networks[len(s.Networks)]` when `len(s.Ports)>0` and would ignore the first `len(s.Ports)` entries of `s.Networks`, fix by shifting access to `s.Networks` back by `len(s.Ports)` so that the final read is `networks[len(s.Networks)+len(s.Ports)-1].UUID=s.Networks[len(s.Networks)+len(s.Ports)-1-len(s.Ports)]` which is necessarily the last member of `s.Networks`
2019-04-01 11:43:21 +01:00
Akshat Mahajan f07e4214cc Addresses issues #5384, #5494: Rename and change `temporary_security_group_source_cidr`
to accept a list of strings (for Amazon builders).

Per this change, `temporary_security_group_source_cidr` in the configuration:

1. Will be renamed to `temporary_security_group_source_cidrs`.
2. Will accept a list of CIDRs.
3. Will have its documentation updated to reflect this change.
4. Will have a fixer attached for newer templates to avail of.
2019-03-30 15:47:03 -07:00
Megan Marsh b3c6dd0baa fix tests 2019-03-29 15:52:41 -07:00
Megan Marsh bcacd331c3 change cpu to cpus and ram_size to memory in order to bring hyper v into line with other builder defaults 2019-03-29 15:12:51 -07:00
Megan Marsh b764b1d7e1 fix tests 2019-03-29 15:05:51 -07:00
Megan Marsh a84fc6bde9 remove default ssh_username from oracle classic builder, but add note in docs. 2019-03-29 14:24:12 -07:00
Megan Marsh af06334114 fix tests 2019-03-29 11:37:23 -07:00
Megan Marsh 6407a579f0 Document why we need windows communicator in code 2019-03-29 11:21:07 -07:00
Megan Marsh 12b9004c76 reduce duplicated code 2019-03-29 11:14:01 -07:00
Megan Marsh 0860edeed8 fix mocks 2019-03-28 16:55:35 -07:00
Megan Marsh 70150ffa0f set powershell entrypoint for windows containers 2019-03-28 16:46:07 -07:00
Megan Marsh 36f2634352 can't use docker cp so call powershell to do this natively. Fix implementation for upload, uploadDir, and download in windows container communicator 2019-03-28 16:20:05 -07:00
Megan Marsh af01860fa9 remove old docker-toolbox limitation. 2019-03-27 15:29:22 -07:00
Megan Marsh 3b87f2a519 stop container before committing if windows 2019-03-27 15:25:51 -07:00
Megan Marsh 8f3313d81e Create new docker communicator for windows containers 2019-03-27 15:25:32 -07:00
Megan Marsh 9f1a4e0fed
Merge pull request #7423 from hashicorp/lock_ports
Lock packer ports using a lock file
2019-03-26 10:35:18 -06:00
Adrien Delorme ac92916b01 StepConfigureVNC: close listener only once 2019-03-26 10:58:51 +01:00
Megan Marsh e97f864016
Merge pull request #7395 from josepand/openstack_force_delete
Expose force_delete for openstack builder
2019-03-25 17:34:00 -06:00
Megan Marsh e5ddf3e56b
Merge pull request #7419 from vhaidamaka/vbox_check_none_communicator
Validate 'none' communicator in the virtualbox builder
2019-03-25 17:09:17 -06:00
Paul Meyer e4bea87a20
Merge pull request #7211 from riezebosch/master
arm-builder: specify zone resilient image from config
2019-03-19 08:59:29 -07:00
Adrien Delorme a3838ecfad error on negative ports 2019-03-19 15:21:09 +01:00
Adrien Delorme 5a6dffde9a use port as ints 2019-03-19 15:01:12 +01:00
Adrien Delorme f828b72c10 step configure vnc: allow to use ESX5Driver again 2019-03-19 12:54:15 +01:00
Adrien Delorme c214f6735b make everything a uint 2019-03-19 12:54:15 +01:00
Adrien Delorme ae182a7c20 qemu stepForwardSSH: use common/net pkg to find open port 2019-03-19 12:54:15 +01:00
Adrien Delorme 446105e384 quemu stepConfigureVNC: use common/net pkg to find open port 2019-03-19 12:54:15 +01:00
Adrien Delorme f67b5ff59d virtualbox StepConfigureVRDP: use common/net pkg to find open port 2019-03-19 12:54:15 +01:00
Adrien Delorme 59370986fb virtualbox StepForwardSSH: use common/net pkg to find open port 2019-03-19 12:54:15 +01:00
Adrien Delorme b5d78d47f5 vmware StepConfigureVNC: use common/net pkg to find open port 2019-03-19 12:54:15 +01:00
Vadym Haidamaka 414d0750f0 Add tests to validate 'none' communicator in the virtualbox builder 2019-03-16 18:18:29 +02:00
Vadym Haidamaka 0263503c45 Validate virtualbox_version_file and guest_additions_mode when communicator is none 2019-03-16 18:15:27 +02:00
Esten Rye ba5385b224 Fix invalid character issue on Windows.
Output from driver includes a `\r` character.  This change adds logic to
trim `\r` and `\n` values from parsed output.

#7414
2019-03-15 20:00:27 -05:00
Megan Marsh d505bc59a0
Merge pull request #7415 from programmer04/improve-name-conflict-msg
fix 7403: Improve error message for conflicting images name
2019-03-15 16:01:41 -07:00
Megan Marsh 24c42e4a1f
Merge pull request #7397 from vhaidamaka/fix-7321
Add vagrant-cloud post-processor support for the vagrant builder
2019-03-15 16:00:05 -07:00
programmer04 596a9cc7ff Improve error message for AWS and Alibaba 2019-03-15 23:38:05 +01:00
Adrien Delorme 9f82b75e57 Use the hashicorp/go-getter to download files
* removed packer.Cache and references since packer.Cache is never used except in the download step. The download step now uses the new func packer.CachePath(targetPath) for this, the behavior is the same.
* removed download code from packer that was reimplemented into the go-getter library: progress bar, http download restart, checksuming from file, skip already downloaded files, symlinking, make a download cancellable by context.
* on windows if packer is running without symlinking rights and we are getting a local file, the file will be copied instead to avoid errors.
* added unit tests for step_download that are now CI tested on windows, mac & linux.
* files are now downloaded under cache dir `sha1(filename + "?checksum=" + checksum) + file_extension`
* since the output dir is based on the source url and the checksum, when the checksum fails, the file is auto deleted.
* a download file is protected and locked by a file lock,
* updated docs
* updated go modules and vendors
2019-03-13 12:11:58 +01:00
Megan Marsh 0196d7f835
Merge pull request #7370 from sargun/allow-users-to-specify-custom-block-device-mapping
amazon-chroot: Allow users to specify custom block device mapping
2019-03-12 14:21:23 -07:00
Vadym Haidamaka 4855bc79c9 Add vagrant-cloud post-processor support for the vagrant builder 2019-03-12 05:33:46 +02:00
josepand f2b42f2b4b Expose force_delete for openstack builder
Very similar to how its exposed in terraform adds an optional force_delete config entry on the openstack builder.
2019-03-11 18:39:47 +00:00
Megan Marsh 67fe820465
Merge pull request #7361 from hashicorp/fix_insecure_skip_tls_verify
fix proxy and tls
2019-03-07 09:21:06 -08:00
Lukas Kämmerling 633934369c
Use Context of run method and allow users to cancel the build 2019-03-07 11:41:39 +01:00
Lukas Kämmerling cc2267fd2a
Fix usage of rescue system 2019-03-07 07:24:22 +01:00
Lukas Kämmerling b6ee0ea736
Fix Format 2019-03-06 08:05:08 +01:00
Lukas Kämmerling 7730cdcb56
Fix usage of freebsd64 rescue image 2019-03-06 07:57:51 +01:00
Megan Marsh 5aeab4ec06
Merge pull request #7300 from kmbulebu/openstack_app_creds
OpenStack: Support Application Credential Authentication
2019-03-05 13:11:51 -08:00
Megan Marsh 8b2fb15f4d
Merge pull request #7375 from lrxcy/fix_190220
fix 'Acceptance Tests can't find image problem'
2019-03-05 09:41:49 -08:00
wb-ywq399345 035b9e5cda fix 'Acceptance Tests can't find image problem' 2019-03-05 16:14:59 +08:00
Megan Marsh 3ed9fe6dee remove unused imports
remove HttpClientWithEnvironmentProxy from amazon builders; let access config handle it
2019-03-04 16:42:33 -08:00
Megan Marsh 0ed57a37a3 dont overwrite session config in ebs builder 2019-03-04 16:41:31 -08:00
Megan Marsh ca9a5daf29 fix proxy and tls 2019-03-04 16:41:31 -08:00
Megan Marsh 3dc1dafe58
Merge pull request #7287 from stephen-fox/ephemeral-ssh-key-pair-issue-7225
virtualbox: create ephemeral SSH key pair for build process
2019-03-04 14:25:04 -08:00
Sargun Dhillon 601e754438 amazon/chroot: Allow creating new block device mappings !not fromScratch
Previously, when you built from an existing image, you were unable
to reconfigure block device mappings, as it just took them and
copied them over. This allows users to specify new, custom
block device mappings, even when building from an existing
image.
2019-03-04 13:11:14 -08:00
Megan Marsh eb98840f18
Merge pull request #7357 from e-mow/issue-7140
Issue 7140
2019-03-01 15:51:39 -08:00
Eric Mowry cef3d0eb24 Ran make fmt per Megan's request. 2019-03-01 14:16:00 -05:00
Megan Marsh ec3b0a5138 fix conflict from mergeing too many things to master at once 2019-03-01 11:13:32 -08:00
Megan Marsh 9d2b06bd61
Merge pull request #7342 from hashicorp/fix_7316
swap region copy and encryption steps
2019-03-01 10:26:43 -08:00
Megan Marsh 0abd16527e
Merge pull request #7337 from sargun/fix-chroot-builder
Amazon-chroot: Fix building PV images and where mount_partition is set
2019-03-01 10:25:04 -08:00
Stephen Fox 7e1cbc6d89 Rename references to key pair name to comment.
Per the OpenSSH manual, the field is for a comment.
2019-03-01 10:00:29 -05:00
Eric Mowry 109ba2c54c After testing a ISO and VMX clone along with setting the display_name option it was determined that having no name for the .vmxf file did not work either. Updating to check if displayName is not empty before using and falling back to VMName if displayName is empty. 2019-02-28 21:36:25 -05:00
Megan Marsh 3b6ff0fe3e
Merge pull request #7106 from hashicorp/revert_docker_changes
docker: user /bin/sh by default
2019-02-28 15:31:53 -08:00
Megan Marsh 0371e2a1b4
Merge pull request #7074 from hashicorp/fix_3329
vmware-iso (esxi) Add check that "format" is not being set when remote_type is empty.
2019-02-28 15:30:54 -08:00
Megan Marsh 424a6a3a7e
Merge pull request #6983 from hashicorp/revert-6979-revert-6925-organization_renaming
DONT MERGE YET: Revert "Revert "Rename attribute api_access_key to organization_id""
2019-02-28 15:30:25 -08:00
Stephen Fox 61a8968b22 Use 'os.OpenFile' to atomically create debug key file.
Per code review feedback.
2019-02-28 17:23:33 -05:00
Stephen Fox 094c87e395 Remove 'SSHPublicKeyUrlEncoded', use 'urlquery' instead.
Per code review feedback, the Go template library supports
encoding variables in URL query format. Instead of exposing
two different public key formats (unmodified string and a
URL encoded string), just have the user apply the 'urlquery'
modifier to their template.
2019-02-28 17:06:51 -05:00
Eric Mowry e74a81e27b Deny the copying of .vmxf from the source VM to the target VM. If this file gets copied over to the new VM once the VM gets deleted the .vmxf and the folder for the VM stay on the datastore. This causes Packer to hang because the folder on the datastore does not go away during the cleanup process. 2019-02-28 16:47:46 -05:00
Eric Mowry 1127096beb Setting extendedconfigfile to the name of the VM so that when ESXi makes the vmxf it is named after the VM and ESXi will properly delete the file when the VM gets deleted. 2019-02-28 16:43:47 -05:00
Adrien Delorme f535464097 up a test 2019-02-27 11:17:56 +01:00
Adrien Delorme f03cbd8a10 aws: allow to pass nil bool as encryption parameter
to retain current encryption settings

this changes the fields :
* ami_config.encrypt_boot
* block_device.encrypted

This also removes StepCreateEncryptedAMICopy as this step is now done in StepAMIRegionCopy
2019-02-27 11:17:56 +01:00
Adrien Delorme ce8532e94b aws: document ValidateRegion better 2019-02-27 11:17:08 +01:00
Adrien Delorme 6af621c37a aws: StepAMIRegionCopy call waitgroup.add only once 2019-02-27 11:17:08 +01:00
Michael F 01a0b0c766 kmsArnStartPattern - fix support for aws-us-gov
While the `kmsArnStartPattern` regexp supports `us-gov` as a region, it does not take the AWS partition into consideration.
For more info see https://docs.aws.amazon.com/govcloud-us/latest/ug-east/using-govcloud-arns.html

Added test case for AWS partition us-gov as well as a negative test case for a non-existing AWS partition.
2019-02-26 16:54:54 -08:00
Megan Marsh 026e543b24 move snapshot deletion to cleanup; this allows people with tag-specific permissions to perform snapshot deletion operation 2019-02-25 17:01:19 -08:00
Stephen Fox 2ef6b9247d Initial take on code review feedback from @azr.
Do not use builder pattern or interfaces; stick to structs and
some basic functions.
2019-02-25 17:16:24 -05:00
Megan Marsh 3b726e66c1 swap region copy and encryption steps 2019-02-25 11:03:03 -08:00
Sargun Dhillon 142a84ef43 amazon/chroot: Refactor step_register_ami for testing EBS-related behaviour
There is some logic around how EBS mappings are handled / generated depending
on whether an image if from scratch or not. There was no testing around
this behaviour before. This strips that logic out into a separate function,
to enable testing it independentlhy.
2019-02-25 10:45:23 -08:00
Megan Marsh 3f7c4f7406
Merge pull request #7341 from hashicorp/fix_7325
openstack WaitForImage: pass context for cancellation
2019-02-25 09:30:36 -08:00
Megan Marsh 05897c8653
Merge pull request #7294 from hyperonecom/hyperone
Add HyperOne builder
2019-02-25 08:30:04 -08:00
Adrien Delorme b9411712eb builder/openstack/step_create_image.go: pass context for cancellation
fix #7325
2019-02-25 15:03:11 +01:00
Miłosz Smółka 94a7a07c87 Merge branch 'master' into hyperone 2019-02-24 15:16:21 +01:00
Miłosz Smółka 0673bb2c57 Add cleanup for stepCreateImage 2019-02-23 14:57:19 +01:00
Sargun Dhillon d3c65ee77d builder/amazon/chroot: Fix building PV images with mount_partition
Right now, if we have a source image that's PV, and try to build an
image with mount_partition set to not 0, it does not get picked up.
This is because under PV we only had a filesystem, not partitions,
but you can convert a PV image to an HVM image during build time.
2019-02-22 18:21:01 -08:00
Joel Lopes c8a60c77d1 Add comments 2019-02-21 18:12:57 -08:00
Joel Lopes 1c030cb54b Use IMDS to get subscription for Azure MSI 2019-02-21 09:35:14 -08:00
Megan Marsh 5cc442872e
Merge pull request #7314 from hashicorp/fix_7234
add noSSLVerify to ovftool args
2019-02-19 16:54:48 -08:00
Manuel Riezebosch d79b54e46a feat(arm-builder): print warning on zone resiliency for currently not supported locations 2019-02-15 19:27:53 +01:00
Manuel Riezebosch f31031f6b1 feat(arm-builder): zone resilient from config 2019-02-15 19:27:32 +01:00
Megan Marsh 75f574bd4b
Merge pull request #7221 from hashicorp/vagrant_builder
Vagrant builder
2019-02-15 10:05:44 -08:00
Megan Marsh cb5c896c01
Merge pull request #7310 from hashicorp/fix_7286
also strip \r to work around windows file ending strangeness
2019-02-15 09:19:33 -08:00
Megan Marsh 9f702af6d9 we lost the skip_add step somewhere 2019-02-14 14:46:14 -08:00
Megan Marsh bbc52f9a7d add noSSLVerify to ovftool args 2019-02-14 12:10:58 -08:00
Megan Marsh be21850e32
Merge pull request #7060 from andrewsomething/do-post-processor
Add digitalocean-import post-processor.
2019-02-14 11:58:00 -08:00