Commit Graph

4149 Commits

Author SHA1 Message Date
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
Megan Marsh bd3339f1f9 also strip \r to work around windows file ending strangeness 2019-02-13 15:41:37 -08:00
Megan Marsh c7278e871c
Merge pull request #7038 from kmbulebu/openstack_deprecated_api
Replaced compute/v2/images with imageservice/v2/images.
2019-02-11 15:05:45 -08:00
Megan Marsh f2439625bf
Merge pull request #7298 from hashicorp/fix_7256
Fix 7256
2019-02-11 14:24:01 -08:00
Megan Marsh 22e3f09db3
Merge pull request #7282 from hashicorp/do_6994
Allow amazon builders to read credentials from Vault.
2019-02-11 12:49:23 -08:00
Megan Marsh 2a613dd6e9 fix up the github suggestion 2019-02-11 11:49:17 -08:00
Adrien Delorme 3ae5a912d4
Update builder/amazon/common/step_pre_validate.go
Co-Authored-By: SwampDragons <megan@hashicorp.com>
2019-02-11 11:41:58 -08:00
Kevin Bulebush cd1f1165ed Support reading app creds from packer config 2019-02-09 22:52:02 -05:00
Kevin Bulebush 2edf3d8b8e Openstack: Added application credential config 2019-02-09 22:52:02 -05:00
Megan Marsh 3fd589fa72 typos 2019-02-08 09:31:30 -08:00
Megan Marsh e2d8c0bfd7 docs 2019-02-08 09:28:10 -08:00
Megan Marsh 07c0c599e0 attach guest additions via SATA when necessasry 2019-02-08 09:15:15 -08:00
Megan Marsh 5057220ad2 use VAGRANT_CWD rather than changing packer run directories 2019-02-07 14:35:01 -08:00
Megan Marsh dc848ea5d7 just make vagrantfile instead of calling init 2019-02-07 12:39:56 -08:00
Miłosz Smółka 228829139b Merge branch 'master' into hyperone 2019-02-07 14:12:13 +01:00
Miłosz Smółka 1ee4517370 Update source_image names in tests 2019-02-07 09:22:30 +01:00
stephen-fox b7719650ae
Merge pull request #1 from stephen-fox/parse-user-supplied-keypair
Parse user supplied keypair
2019-02-06 15:07:04 -05:00
chris marget 53c0376dfd don't print keypair to the user's screen 2019-02-06 13:54:05 -05:00
chris marget 13cc73d600 keypair parsing and testing 2019-02-06 13:46:55 -05:00
Miłosz Smółka fdf028c463 Search SCSI device in /sys/bus due to issues with by-path 2019-02-06 12:30:14 +01:00
Megan Marsh e56d7f7234 fix tests 2019-02-05 15:34:59 -08:00
Megan Marsh 608b7cb7a3 review comments 2019-02-05 15:16:47 -08:00
Megan Marsh 3704a053d0 move region validation and credential wait into step pre validate 2019-02-05 14:07:04 -08:00
Stephen Fox 354fcc5cc6 Merge branch 'master' into 'ephemeral-ssh-key-pair-issue-7225'. 2019-02-05 16:16:51 -05:00
Stephen Fox f9d24ccda0 Allow user to get public key straight up, or URL encoded. 2019-02-05 11:59:13 -05:00
Miłosz Smółka 0d8e9f50bf Add proper SCSI search 2019-02-05 16:20:42 +01:00
Paul Meyer 68516fc05c Fix Azure interactive authentication
Builder looks up tenant ID before asking for token. Client config did
not allow that. Also found that token provider was not properly
initialized.

Fixes 7267
2019-02-05 02:35:12 +00:00
Megan Marsh a7d9d62996 fix tests on windows 2019-02-04 16:11:25 -08:00
Megan Marsh 8add176ab7 finish first pass at vault code; needs testing and cleanup of error messages 2019-02-04 15:54:14 -08:00
Megan Marsh 7a78b47e83 make vault engine stuff into a little struct for easier management 2019-02-04 15:29:45 -08:00
Megan Marsh af7131b169 tests, logic cleanup, docs for vagrant builder 2019-02-04 14:08:43 -08:00
Megan Marsh 52892699ca make it work with a local vagrant box 2019-02-04 14:08:43 -08:00
Megan Marsh ad21367b21 vagrant builder 2019-02-04 14:08:43 -08:00
Stephen Fox f2c11b55be Renamed authorized_keys public key function. 2019-02-04 14:27:14 -05:00
Stephen Fox ea2a7c3fe9 Merge branch 'master' into 'ephemeral-ssh-key-pair-issue-7225'. 2019-02-04 12:47:42 -05:00
Stephen Fox 01c98f3d82 Tweaked debug SSH private key file name for vbox. 2019-02-04 12:47:18 -05:00
Stephen Fox c6ae8654d9 Moved SSH key pair code into 'helper/ssh'. 2019-02-04 12:21:58 -05:00
Stephen Fox 25775886a8 Properly set SSH key pair name. 2019-02-04 12:12:18 -05:00
Stephen Fox be081944b1 Moved new key pair funcs closer to builder funcs. 2019-02-04 12:09:23 -05:00
Stephen Fox b1b67ecffa Added support for setting a name in SSH key pair.
Also refactored how new SSH key pairs are created, and how the
tests are structured.
2019-02-04 12:07:32 -05:00
Stephen Fox 5893134c61 Updated comment for 'PrivateKeyPemBlock()'. 2019-02-04 10:02:07 -05:00
Stephen Fox cd4ae03324 Create / use SSH key pairs in vbox builders.
This follows the business logic for creating / using SSH key pairs
in the cloud-type builders (e.g., Amazon EC2).
2019-02-03 12:20:52 -05:00
Stephen Fox 72d1501551 Made SSH public key available in vbox boot command.
The SSH public key (in authorized_keys format) can be retreived in
the build template by specifying '{{ .SSHPublicKey }}'. The key is
URL encoded to escape spaces.
2019-02-03 12:20:42 -05:00
Stephen Fox 459bd1ea7a Added vbox step for SSH key pair business logic. 2019-02-03 12:07:57 -05:00
Stephen Fox 6824806e6f Allow caller to specify new line for SSH public key.
The default behavior of the various builders that create SSH key
pairs appears to be to add a trailing new line. This will be the
default behavior, but at least it can be customized if desired.
2019-02-03 10:37:32 -05:00
Stephen Fox ad075ffac3 Added 'Description()' to 'sshKeyPair'.
Also cleaned up tests.
2019-02-03 09:17:18 -05:00
Miłosz Smółka f7de056f23 Add proper cleanup of chroot disk
Closes #3
2019-02-03 00:30:56 +01:00
Miłosz Smółka 5e8eade205 Add support for custom API url of compatible service
Closes #4
2019-02-02 14:05:06 +01:00
Miłosz Smółka 6921cc93a9 Add acceptance tests for chroot 2019-02-01 18:58:16 +01:00
Miłosz Smółka 4704565869 Rename vm_flavour to vm_type 2019-02-01 18:57:43 +01:00
Miłosz Smółka e7e84f04e7 Fix timestamp interpolation in mount path
Closes #1
2019-02-01 17:46:35 +01:00
Murcurio 60c7d22ffb
Change metadata url to FQDN
If instance has a different DNS/search domain then "metadata" alone won't work. The FQDN of "metadata.google.internal" is included in hosts file, and will work regardless of DNS configuration. Alternatively the IP 169.254.169.254 can be used.
2019-02-01 15:36:40 +11:00
Megan Marsh eef4fc7a01
Merge pull request #7222 from Adezandee/gce-post-processors
googlecompute-postprocessors: service account and export configs
2019-01-31 16:58:42 -08:00
Megan Marsh 6ea64bc378
Merge pull request #7191 from arizvisa/GH-7190
Adds support to the vmware builders for specifying the number of cores per socket via the `cores` option.
2019-01-31 15:27:52 -08:00
Stephen Fox f233e54992 Initial SSH key pair helper implementation. 2019-01-30 22:10:27 -05:00
Yaakov 0a08920816 Hyper-V: Fix integer overflows in 32-bit builds 2019-01-31 13:53:01 +11:00
Miłosz Smółka 3d3e933f48 Add host key hash verify 2019-01-29 10:44:23 +01:00
Miłosz Smółka bd4ce90728 Add chroot disk build 2019-01-28 12:33:25 +01:00
Megan Marsh 035c3506ba manually set proxyfromenvironment in default http client for ec2 sessions 2019-01-25 12:33:25 -08:00
Megan Marsh c63b54a1e7 move http with proxy call into a helper function 2019-01-25 12:32:52 -08:00
Megan Marsh 904c4b9adb
Merge pull request #7230 from hashicorp/up-aws-sdk-go
Don't try to guess region from metadata if not set + update aws-sdk-go
2019-01-25 10:06:11 -08:00
Adrien Delorme 4a2773f8fa remove default max retries config of 8, it will now be used from env
removing the code that wants to guess region from metadata allows us to change that setting, which can now be taken from environment.
2019-01-25 13:51:02 +01:00
Adrien Delorme 964b149df2 aws: remove now unused AccessConfig.metadataRegion 2019-01-25 13:03:14 +01:00
Adrien Delorme 335f442b51 aws: unwrap AccessConfig.region func
* it was used only in the Session() call.
* default region guessing from metadata should happen in the SDK, not 'manually'
2019-01-25 13:02:42 +01:00
Adrien Delorme 54af9951a8 make guard clauses to clearly see success pass 2019-01-25 13:00:21 +01:00
Adrien Delorme 0864b4d07b name unclear import 2019-01-25 12:59:43 +01:00
Arnaud Dezandee 91d2cb8c83
googlecompute-import: add service accounts 2019-01-25 11:36:18 +01:00
Megan Marsh a0c238940e
Merge pull request #7223 from hashicorp/fix_7200
escape query as suggested in issue #7200
2019-01-24 09:48:38 -08:00
Megan Marsh e4dca0016c
Merge pull request #7156 from vtolstov/qemu
qemu: Add configuration options to specify cpu count and memory size
2019-01-23 15:19:08 -08:00
Megan Marsh d0e5c67dc3
Merge pull request #7205 from hashicorp/fix_7196
fix region stuff
2019-01-23 15:15:27 -08:00
Megan Marsh ce8f5c31df escape query as suggested in issue #7200 2019-01-23 11:04:14 -08:00
Miłosz Smółka 3ce05c7c26 Add acceptance tests 2019-01-23 14:59:28 +01:00
Miłosz Smółka be30415395 Add HyperOne builder 2019-01-23 14:04:05 +01:00
Vasiliy Tolstov b6ebe00249 provide memory and cpus like other builders does
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2019-01-23 13:21:52 +03:00
Adrien Delorme f57953d4ff Docker needs a temporary dir that is inside the $HOME dir 2019-01-18 16:42:04 +01:00
Adrien Delorme f19b7c0300 Revert "aws: test timeout when no credenrtials are set" Revert "aws: set max retries back to 20"
This reverts commits b8b3e64cff and 993af36f2e.
2019-01-18 12:40:02 +01:00
Adrien Delorme b8b3e64cff aws: test timeout when no credenrtials are set 2019-01-18 11:43:52 +01:00
Adrien Delorme 993af36f2e aws: set max retries back to 20 2019-01-18 11:43:26 +01:00
Ali Rizvi-Santiago 9d2f98394e Revert "Renamed the terse option, `cores`, to to the less-terse version `cores_per_socket`."
This reverts commit 0c37a3c68f and avoids bikeshedding from other committers.
2019-01-17 14:49:07 -06:00
Ali Rizvi-Santiago 0c37a3c68f Renamed the terse option, `cores`, to to the less-terse version `cores_per_socket`. 2019-01-17 10:39:19 -06:00
Ali Rizvi-Santiago 4894873971 Added logic to the vmware-iso builder that appends the number of cores per socket to the vmx in `stepCreateVmx`. 2019-01-17 10:39:19 -06:00
Ali Rizvi-Santiago 062c62eed8 Added support for specifying the number of cores as `cores` to vmware-common. 2019-01-17 10:39:19 -06:00
Megan Marsh e0543246fa remove commented code 2019-01-16 11:05:11 -08:00
Megan Marsh 783ed32e7e fix region stuff 2019-01-16 11:02:58 -08:00
Paul Meyer e189db97d4 [azure] deallocate instead of just power-off
1. allegedly prevents error where  fails because VM still appears running
2. prevents left-behind VM's after failures from accumulating charges
2019-01-16 00:31:23 +00:00
Paul Meyer aa29facdae Allow certificate bearer JWT client authentication
This allows certificate based authentication, both by just referencing
the certificate file as well as by providing a bearer JWT. This last
option allows authentication without exposing the private key to packer
using an expiring JWT containting the thumbprint (and sometimes the
whole certificate for subject/issuer based auth), signed using the
certificate private key.
2019-01-15 17:29:28 +00:00
Paul Meyer 7e34579b7e Factor out Azure client credential config 2019-01-15 17:23:57 +00:00
Adrien Delorme 9ddec470a0
Merge pull request #7188 from hashicorp/dedupe_step_output_dir
deduplicate step_output_dir and move to common folder
2019-01-15 17:28:21 +01:00
Megan Marsh 126ca2a877
Merge pull request #7158 from rickard-von-essen/fix-7155
WIP: parallels: Fix attaching prl tools
2019-01-11 15:30:37 -08:00
Megan Marsh 97a791389a deduplicate step_output_dir and move to common folder 2019-01-11 15:06:36 -08:00
Adrien Delorme c8a39e939a
Merge pull request #7178 from edwardmlyte/simplify-version-check
Simplify version check for port count argument
2019-01-10 16:07:00 +01:00
Ed Maxwell-Lyte e8e92fe6c6 rename clashing import 2019-01-09 16:30:54 +00:00
Ed Maxwell-Lyte 4437f8d8ba Use go-version for comparison 2019-01-09 16:22:33 +00:00
Ed Maxwell-Lyte 346f5d9bba Simplify version check for port count argument
Might be personal preference, but I think this reads more clearly
2019-01-09 09:46:24 +00:00
Adrien Delorme 9f7b4ffc17
Merge branch 'master' into pr/6950 2019-01-09 10:11:18 +01:00
Adrien Delorme 19cbb9cb24
Merge pull request #7136 from hashicorp/fix_5984
Add "version" option to hyperv calls
2019-01-09 10:06:49 +01:00
Adrien Delorme 1b84019a45
Merge pull request #7174 from edwardmlyte/reverse-default-vbox-portcount-arg
Make portcount default argument for storagectl
2019-01-08 17:35:43 +01:00
Ed Maxwell-Lyte 4fc02ea406 Assign to existing var 2019-01-08 16:19:11 +00:00
Adrien Delorme f91b668617
Create portCountArg in the if statement
You can't assign to something that doesn't exist

Co-Authored-By: edwardmlyte <edwardmlyte@gmail.com>
2019-01-08 16:15:24 +00:00
Ed Maxwell-Lyte a9eed311a6 Run gofmt on driver_4_2.go 2019-01-08 15:58:12 +00:00
Rickard von Essen c8fab8c7a3
Merge pull request #7037 from kmbulebu/openstack_tags
openstack: `image_tags` - Adds support for tagging new images.
2019-01-08 16:53:21 +01:00