Commit Graph

2059 Commits

Author SHA1 Message Date
nouney 4605f9559f Fix unreachable code 2016-09-23 20:38:28 +02:00
Valentin Tjoncke 6f545af7f7 builder/googlecompute: -force 2016-09-23 14:21:43 +02:00
Rickard von Essen c95aab5e0e Merge pull request #3888 from yoctocloud/qemu
builder/qemu: specify disk format to avoid errors
2016-09-22 08:43:40 +02:00
Rickard von Essen 06e3539ffa Merge pull request #3767 from taliesins/ExtendScanCodes
Add support for ctrl, shift and alt keys and using them as key modifier.
2016-09-20 21:36:46 +02:00
Rickard von Essen 9ce70bfce0 Merge pull request #3338 from yuki-takeichi/gce-nvme 2016-09-20 12:50:43 +02:00
Yuki Takeichi 04078c5c48 Enable to select NVMe images for googlecompute builder 2016-09-20 12:47:14 +02:00
Rickard von Essen 13c9db5dd5 Merge pull request #3885 from orivej/on-error
Add -on-error command line argument to allow preserving artifacts on builder errors
2016-09-20 12:28:14 +02:00
Rickard von Essen 476d981211 Merge pull request #3800 from benwtr/issue-3142-match-dotfiles-docker-communicator
Fix file provisioner dotfile matching w/ docker builder
2016-09-20 12:25:37 +02:00
Matthew Hooker 7cbb98f2d5 QemuArggs -> QemuArgs
Avast ye, resolves #3901
2016-09-19 14:34:13 -07:00
Jeremy Asher aea05f6485 fix nil pointer dereference in amazon-chroot
The refactor of StepRegisterAmi to add the from_scratch parameter
incorrectly replaced iteration over image.BlockDeviceMappings with
iteration over the new mapping array when not using from_scratch.  This
fixes the regression and renames the parameters to newMappings and
mappings for better clarity.
2016-09-16 18:35:36 -07:00
Orivej Desh 6762965696 Add -on-error command line argument to allow preserving artifacts on builder errors
Resolves #409
2016-09-16 12:15:00 +00:00
Vasiliy Tolstov 4986ef39b2 builder/qemu: specify disk format to avoid errors
Image format was not specified for XXX and probing
guessed raw.
Automatically detecting the format is dangerous for raw images, write
operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-09-15 17:59:05 +03:00
Rickard von Essen 3b47893eb8
builder/amazon: reverted wrongly modified ssh_test's. 2016-09-14 20:26:09 +02:00
jasminSPC 178748bb7c Merge remote-tracking branch 'upstream/master' into packer-builder-profitbricks 2016-09-14 15:32:30 +02:00
jasminSPC 2008c6019a Addressing PR remarks 2016-09-14 15:05:45 +02:00
Rickard von Essen 067155c344
builder/amazon: guard aginst empty/nil PrivateIpAddress and updated tests. 2016-09-14 00:16:09 +02:00
Rickard von Essen 7f4bee737c Merge pull request #3752 from tarrall/issue3751-ssh-privateip-classic
builder/amazon: Honor ssh_private_ip flag in EC2-Classic, not just VPC
2016-09-13 22:54:00 +02:00
Rickard von Essen 3ab49595e6 Merge pull request #3681 from yoctocloud/communicator
builder/qemu: dont fail on communicator set to none
2016-09-13 22:45:12 +02:00
jasminSPC 325401eaf0 Merge remote-tracking branch 'upstream/master' into packer-builder-profitbricks 2016-09-13 12:06:45 +02:00
Ali Rizvi-Santiago a3f0308e92 Re-implemented the support for the floppy_files keyword in order to remain backwards-compatible with templates using the old syntax.
Moved the support for recursive paths from the floppy_files keyword to the new floppy_contents keyword.
Shifted some of the code around to add better logging of what's actually being copied.
Added a couple of unit-tests for the new floppy_contents implementation.
Ensured that all files that were being added were also being included in state.FilesAdded so that the older unit-tests will work.
2016-09-12 11:56:25 -05:00
Rickard von Essen 120b60ae37 Merge pull request #3865 from dpiddy/amazon-ssh-retry-fix
amazon/common/ssh: fix saving of instance to state
2016-09-12 15:04:35 +02:00
Rickard von Essen 10cba9795f Merge pull request #3476 from bhcleek/ansible-with-docker
fix docker builder with ansible provisioner
2016-09-12 13:56:28 +02:00
Rickard von Essen ed1b664d65 Merge pull request #3855 from jeremy-asher/chroot-from-scratch
amazon-chroot build AMI from scratch
2016-09-12 13:48:04 +02:00
Rickard von Essen c3861d1675 Merge pull request #3856 from rickard-von-essen/ecr-support
Improved support for Amazon EC2 Container Registry - ECR
2016-09-12 13:43:41 +02:00
Rickard von Essen 1ca79ad0cb Merge pull request #3873 from crunk1/master
With testify deps fix.
2016-09-12 12:54:25 +02:00
Rickard von Essen 5cbc36103e Merge pull request #3756 from ricardclau/floppy_check
Test floppy disks actually exist
2016-09-12 08:05:16 +02:00
Scott Crunkleton b54b82d3ac Some googlecompute fixes and cleanup. Addresses https://github.com/mitchellh/packer/issues/3829. Changes:
- startup scripts don't run for Windows since it is isn't implemented yet.
- startup scripts use instance metadata instead of serial port output to flag when they are done.
- added licenses to Image data type (to check if an Image is a  Windows Image).
- added GetImage and GetImageFromProject to googlecompute Drivers.
- changed some of the builder/googlecompute tests to use github.com/stretchr/testify/assert.

Tests:
- (in the Packer directory) `go test .`, `go test ./builder/googlecompute`, and `go test ./post-processor/googlecompute-export`
- manual run of `packer build packer_template.json` with the following files

--packer_template.json--
{
  "builders": [
    {
      "type": "googlecompute",
      "account_file": "creds.json",
      "project_id": "google.com:packer-test",
      "source_image": "debian-8-jessie-v20160629",
      "zone": "us-central1-a",
      "startup_script_file": "startup_script.sh",
      "metadata": {
        "startup-script": "#!/bin/sh\necho \"This should be overwritten.\"",
        "startup-script-log-dest": "gs://packer-test.google.com.a.appspot.com/startup-script.log"
      },
      "image_name": "test-packer-modifications",
      "ssh_username": "foo"
    }
  ],
  "post-processors": [
    {
      "type": "googlecompute-export",
      "paths": [
        "gs://packer-test.google.com.a.appspot.com/foo.tar.gz",
        "gs://packer-test.google.com.a.appspot.com/bar.tar.gz"
      ],
      "keep_input_artifact": true
    }
  ]
}

--startup_script.sh--
\#!/bin/sh
echo "Hi, my name is Scott. I'm waiting 60 seconds!" >> /scott
sleep 60
echo "I'm done waiting!" >> /scott
2016-09-09 16:22:50 -07:00
Dan Peterson c7af9a67bc amazon/common/ssh: fix saving of instance to state
Fixes #3496
2016-09-09 10:16:53 -03:00
Rickard von Essen f446c1a1b7
builders/digitalocean: fixes timeout waiting for snapshot #3853 2016-09-08 10:32:43 +02:00
Rickard von Essen b2d9782a9e
Improved support for Amazon EC2 Container Registry - ECR
This adds support for authenticating towards ECR in the docker builder
and docker-push post-processor using them same mechanisms as in the
amazon builders. I.g. access key/secret key, credentials on file,
environment variables, sts tokens or IAM instance roles.
2016-09-04 14:33:47 +02:00
Jeremy Asher 1c392b23f9 generate warnings for unused options with from_scratch 2016-09-03 12:32:43 -07:00
Jeremy Asher ef0c7543e1 add amazon-chroot post mount commands
This adds an additional PostMountCommands step to the amazon-chroot
builder which executes after the volume is mounted, but before the
extra chroot mounts and copy step.
2016-09-03 12:32:41 -07:00
Jeremy Asher 5e8b697a76 add from_scratch option to amazon-chroot builder
This provides an alternate mode for the amazon-chroot builder which uses
a blank volume to build the image.  It adds StepPreMountCommands to
permit partitioning and format commands to be executed before mounting
the new volume.
2016-09-03 12:28:22 -07:00
Jeremy Asher 85ae04bb75 split up BlockDevices in amazon/common
This breaks up the two options provided by BlockDevices into separate
structs to allow only one of them to be used by the amazon-chroot
builder.
2016-09-03 09:58:45 -07:00
Chris Lundquist defdd1ecf3 Merge remote-tracking branch 'origin/master' into dynamic-source-ami 2016-09-02 01:43:03 +00:00
Rickard von Essen 16158622fe Merge pull request #3836 from mahcsig/3833-incorrect-ssh-port
Issue 3833 - fix for port error in PR 3347
2016-09-01 20:52:56 +02:00
jasminSPC d84b3af863 Fixed tests 2016-08-31 14:11:10 +02:00
jasminSPC 8f8907ee13 Merge remote-tracking branch 'upstream/master' into packer-builder-profitbricks 2016-08-31 13:56:51 +02:00
jasminSPC 5caa54acd7 Addressed all the comments 2016-08-31 13:55:11 +02:00
Rickard von Essen ba629922c6 Merge pull request #3662 from ryansb/boost-spot-bid
(AWS Spot) Add 0.5 cents to discovered spot price
2016-08-27 03:18:59 +02:00
Ingo Gottwald 0c1051a017 GCE builder: Switch to google.DefaultClient (#3655)
* GCE builder: Switch to google.DefaultClient

This enables authentication through an authenticated gcloud tool.

* GCE builder: Add docs about auth mech precedence
2016-08-27 03:12:55 +02:00
Marc Siegfriedt c1e129848c 3833 - fix for port in MR3347 2016-08-26 20:58:04 +00:00
Krzysztof Wilczynski d01fb65dcf Fix. Use temporary_key_pair_name when specified. (#3739)
Fix: Use temporary_key_pair_name when specified.

This is to fix an issue where the temporary_key_pair_name configuration option
for amazon-ebs and amazon-instance builders would be ignored and replaced with
an automatically generated value using UUID, even when the option was explicitly
specified.

Remove space from the auto-generated SSH key-pair name.

Resolves #3736
2016-08-25 09:17:57 +02:00
Lamoni Finlayson d02b106a16 Fix for issue #2972 - Implemented ssh_host for virtualbox builders (#3617) 2016-08-24 18:30:26 +02:00
Chris Lundquist 3cc8d35450 [dynamic-source-ami] fix old key name in error message 2016-08-21 00:58:01 +00:00
Chris Lundquist b4d20706ce [dynamic-source-ami] add some very basic tests 2016-08-21 00:29:51 +00:00
Chris Lundquist 57e7a1a3e6 [dynamic-source-ami] fix lint error 2016-08-21 00:07:58 +00:00
Chris Lundquist 95afaa58ca [dynamic-source-ami] rename to source_ami_filter 2016-08-20 23:34:22 +00:00
Chris Lundquist 0e248f1516 [dynamic-source-ami] make most_recent work 2016-08-20 23:08:45 +00:00
Chris Lundquist ec1abb9448 [dynamic-source-ami] proof of concept 2016-08-20 18:58:36 +00:00
Rickard von Essen 6cd7ad82bb Fixed dupliceted test 2016-08-19 14:34:24 +02:00
Rickard von Essen 3e1aed9a6f Enable to disable vnc password for VMware builder 2016-08-19 13:26:23 +02:00
Israel Shirk f961ce701b Adds password protection for VNC on VMWare 2016-08-19 13:26:16 +02:00
Jeremiah Roth 9489c83f0f If the VM has more than one NIC, loop through until we find one that works (#3347) 2016-08-19 13:23:43 +02:00
mahcsig 832d45023b Re-introduce case sensitive vmx key functionality (#2707)
Add case sensitive vmx key functionality
2016-08-19 13:23:07 +02:00
Dan Tran 4ac6e2a08c Dont check for poweron command error to force retry at state check (#3195) 2016-08-19 13:21:50 +02:00
Charlie Vieth 6ce847e720 Do not add remotedisplay.vnc.ip to vmx data on ESXi
* The remotedisplay.vnc.ip vmx data key breaks ESXi, this commit prevents it
  from being automatically added during VNC configuration when using the ESX5
  driver.

* It can still be configured via the vmx_data section of the builder
  template

Signed-off-by: Sunjay Bhatia <sbhatia@pivotal.io>
2016-08-19 13:19:04 +02:00
Charlie Vieth d14d62074e Add winrm functionality to vmware-iso builder (#3738)
* Use winrm_host, if provided, this allows packer to work in ESXi
environments without DHCP.

Signed-off-by: Charlie Vieth <cviethjr@pivotal.io>
2016-08-19 13:02:55 +02:00
crunk1 55b5a45ae4 Created googlecompute-export post-processor. Modified the googlecompute builder to pass a few configuration values to its resulting artifact. These values can then be used in googlecompute-export post-processor.
Added documentation and changed authentication stuff on temporary VM.
2016-08-15 14:36:26 -07:00
Toby Jaffey 37ef03c41c Use config StateTimeout for DigitalOcean unlock and off transitions. (#3444)
Use config StateTimeout for DigitalOcean unlock and off transitions.
When DigitalOcean's API is responding slowly, the hardcoded timeouts are too short.
2016-08-14 21:12:30 +02:00
Ben P 8ecbbe9037 backticks instead of $() for csh compatibility 2016-08-11 11:27:56 -07:00
Ben P 0d7937fce1 [docker] ls -A instead of * glob for copying paths 2016-08-11 18:03:48 +00:00
Jeremy Asher 6130b8588d remove check for AMIs when deleting vols
This removes the unnecessary check for AMIs before cleaning up volumes.
AMIs will exist on a successful run, but not when a build fails after
instance creation (during provisioning for example).  The following
check for instance being nil should be sufficient.
2016-08-08 14:16:43 -07:00
Eric Johnson 0e334e67be Merge pull request #3774 from evandbrown/google-external-ip-optional
builder/googlecompute: provision VM without external IP address
2016-08-02 15:39:01 -07:00
Evan Brown a5c598264f builder/googlecompute: Support provisioning VM without external IP address
This change adds an `omit_external_ip` configuration property that, when true,
will cause no external IP address to be associated with the Google Compute
Engine VM provisioned to create an image. When using `omit_external_ip`, you
must also set the `use_internal_ip` configuration property to true.

Addresses #3296
2016-08-02 13:43:04 -07:00
Christopher Boumenot ece0a78990 azure: tag all resources 2016-08-02 11:25:03 -07:00
jasminSPC e1aaef1f53 Fixed unit tests 2016-08-01 13:30:28 +02:00
jasminSPC a61716d4a4 Merge remote-tracking branch 'upstream/master' into packer-builder-profitbricks
# Conflicts:
#	Godeps/Godeps.json
2016-08-01 13:09:07 +02:00
jasminSPC 92e0f2bf4c Merge remote-tracking branch 'upstream/master' into packer-builder-profitbricks
# Conflicts:
#	Godeps/Godeps.json
2016-08-01 12:09:03 +02:00
Taliesin Sisson 1155c6d4d6 Use the correct fmt verb for log output 2016-07-31 19:46:38 +01:00
Taliesin Sisson a87ad05866 Add support for ctrl, shift and alt keys.
Add support for using ctrl, shift and alt as key modifiers. So you can now achieve ctrl+c by using "<leftCtrlOn>c<leftCtrlOff>".

Updated documentation for new key stroke tokens.
2016-07-31 19:05:10 +01:00
Ali Hamidi c6a527dc46 throw error if encrypted ami is shared 2016-07-29 15:01:24 -07:00
Ali Hamidi 1cecda639a add encrypted boot volume acceptance test 2016-07-29 15:01:24 -07:00
Ali Hamidi 902ae375b3 delete unencrypted snapshot 2016-07-29 15:01:24 -07:00
Ali Hamidi 53b3867c50 allow packer to create an encrypted copy of the AMI 2016-07-29 15:01:24 -07:00
Christopher Boumenot 871ca8c3d9 azure: Support for a user define VNET.
Two new configuration options have been exposed to allow users to specify
an existing virtual network: virtual_network_name and
virtual_network_resource_group_name.

 * virtual_network_name: name of the virtual network to attach a Packer VM
 to.

 * virtual_network_resource_group_name: name of the resource group that
 contains the virtual network.  This value is optional.  If the value is
 not specified, the builder queries Azure for the appropriate value.  If
 the builder cannot disambiguate the value, a value must be provided for
 this setting.

 * virtual_network_subnet_name: name of the subnet attached to the virtual
 network.  This value is optional.  If the value is not specified, the
 builder queries Azure for the appropriate value.  If the builder cannot
 disambiguate the value, a value must be provided for this setting.
2016-07-28 21:31:59 -07:00
Robert Heinzmann 3a700414ca Fix License check to work with licensed vmware player 2016-07-28 10:42:58 +02:00
Ricard Clau acededfc6e tests actually test the floppies 2016-07-27 21:59:21 +01:00
Robert Tarrall 94bf981d3b Honor ssh_private_ip flag in EC2-Classic, not just VPC
VpcId will be nil in Classic, but we may still wish to ssh to the
instance's private IP address -- if for example we are using security
groups to block SSH access via the public IP.
2016-07-26 08:15:44 -06:00
Scott Crunkleton 7190fbeed8 Adding support for googlecompute startup scripts.
- Startup scripts can be provided through the instance creation metadata field 'startup-script'.
- Script log can be copied to a GCS location by setting the metadata field 'startup-script-log-dest'.
Added Retry method to googlecompute package.
Added GetSerialPortOutput to googlecompute Drivers.
Added StepWaitInstanceStartup (and associated test) which waits for an
instance startup-script to finish.
Changed the instance service account to use the same service account as the one provided in the Packer config template. It was the project default service account.

Tested googlecompute package with 'go test' and also performed builds
with a startup script and without a startup script.
2016-07-20 14:54:36 -07:00
Christopher Boumenot 97b1915d51 Update Azure dependencies
* azure-sdk-for-go to 3.1.0-beta
 * go-autorest to 7.0.7
 * import dgrijalva/jwt-go at 3.0.0
2016-07-20 14:21:40 -07:00
Christopher Boumenot 323dc70ed6 Merge remote-tracking branch 'origin/master' into pr-3680-update-azure-sdk 2016-07-20 12:08:28 -07:00
Christopher Boumenot 6e9ef1c6eb Use WithBaseURI 2016-07-20 11:23:51 -07:00
Christopher Boumenot 7d259ab098 Update Azure dependencies.
* azure-sdk-for-go to 3.1.0-beta
 * go-autorest to 7.0.7
 * dgrijalva/jwt-go to 3.0.0

Add the German cloud configuration.
Ensure the different cloud URLs are _actually_ used.
2016-07-20 10:47:46 -07:00
Christopher Boumenot ddef181e76 Merge pull request #3724 from boumenot/pr-azure-lint
Azure: Lint issues
2016-07-19 12:31:23 -07:00
Chris Bednarski c0b637b0c5 Merge pull request #3733 from envato/no-shutdown-behaviour-instance-backed
No shutdown behaviour instance backed
2016-07-19 01:49:05 -07:00
Christopher Boumenot 408fe9bc18 Lint issues 2016-07-15 22:42:49 -07:00
Christopher Boumenot c575e60f67 Merge pull request #3693 from boumenot/pr-approvals
Update to an official version of Approvals
2016-07-15 21:34:24 -07:00
Christopher Boumenot e33a325323 Use VerifyJSONStruct 2016-07-15 21:31:03 -07:00
Christopher Boumenot c7262d6426 Ignore Created and Updated
The Azure response has changed, and is breaking the code's ability to
properly deserailize the response.
2016-07-15 21:06:03 -07:00
Christopher Boumenot 130cea91d4 Update to an official version of Approvals
The in-project version of Approvals has been moved to its own GitHub
project under the offcial umbrella.  This PR snaps to that version of the
code.an official version of Approvals

The in-project version of Approvals has been moved to its own GitHub
project under the offcial umbrella.  This PR snaps to that version of the
code.
2016-07-11 15:04:41 -07:00
jasminSPC fc4c88dc6d Fixed tests 2016-07-08 19:19:19 +02:00
jasminSPC dd8ce6a907 Merge remote-tracking branch 'upstream/master' into packer-builder-profitbricks 2016-07-07 10:29:25 +02:00
jasminSPC d575cd62ec Cleaned up the code 2016-07-07 10:28:46 +02:00
Ricard Clau 172a1c7a57 add source ami to output 2016-07-07 00:05:59 +01:00
Vasiliy Tolstov 83f175cac7 builder/qemu: dont fail on communicator - none
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-07-07 00:49:23 +03:00
Chris Bednarski ee5c5260a4 Merge pull request #3663 from liv3d/add_ap-south-1
Add support for ap-south-1 in AWS
2016-07-06 14:09:24 -07:00
Rickard von Essen cd0620d1f8 Merge pull request #3673 from rickard-von-essen/prl-support-future-ver
Support future versions of Parallels by using the latest driver
2016-07-06 22:58:01 +02:00
Christopher Boumenot 16c1abf1d4 Fix slow unit tests. 2016-07-06 11:06:52 -07:00
Chris Bednarski 443ffd68f2 Added explicit error when SG is not working 2016-07-02 15:48:51 -07:00