Commit graph

307 commits

Author SHA1 Message Date
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
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
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
Arnaud Dezandee
91d2cb8c83
googlecompute-import: add service accounts 2019-01-25 11:36:18 +01:00
Mikhail Ushanov
536252683e builders: reuse private key file reading function
Signed-off-by: Mikhail Ushanov <gm.mephisto@gmail.com>
2018-11-08 14:25:50 +03:00
Matthew Aynalem
28eff7303e builder/googlecompute: validate startup_script_file exists 2018-10-15 16:09:33 -07:00
Adrien Delorme
b2e2d3b008 removed unused processPrivateKeyFile func & tests 2018-10-09 11:56:43 +02:00
Adrien Delorme
146db5667a fix intermitent TestProcessPrivateKeyFile_encrypted failure
Because of deficiencies in the encrypted-PEM format, it's not always possible to detect an incorrect
password. In these cases no error will be returned but the decrypted DER bytes will be random noise.

this closes #3337
2018-10-01 10:29:30 +02:00
Megan Marsh
38cc525ec7 new option allowing user to clean up the ephemeral ssh key from the authorized_keys file 2018-09-14 11:06:38 -07:00
Megan Marsh
a0edaf6c46 Going to revert this change for now, becuase of potential issues that arise from calling Prepare() twice
Revert "use statebag instead of SetSharedState for winRM password"

This reverts commit b35acbd879.
2018-09-10 16:48:42 -07:00
Megan Marsh
d00b815c06 Update public google cloud image projects 2018-08-31 13:13:19 -07:00
Adrien Delorme
157691c710 remove unecessary get/pug config in tests; those are being referenced 2018-08-30 12:07:37 +02:00
Adrien Delorme
94d5bb7a3b revert test changes of builder/googlecompute/step_create_ssh_key_test.go 2018-08-30 12:04:21 +02:00
Adrien Delorme
050a98e8bb googlecompute builder: use config from statebag 2018-08-29 18:15:09 +02:00
Adrien Delorme
4982627dd2 builder.gcp: use c.Comm for ssh 2018-08-29 14:40:33 +02:00
Adrien Delorme
d49ad12895 update gcp ssh tests 2018-08-29 14:40:32 +02:00
Adrien Delorme
663c8134ef GCP: put ssh public/private key in config 2018-08-29 14:40:32 +02:00
Adrien Delorme
51d2aac9f6 SSHPrivateKey => SSHPrivateKeyFile 2018-08-29 14:40:32 +02:00
Megan Marsh
b35acbd879 use statebag instead of SetSharedState for winRM password 2018-08-24 13:51:16 -07:00
Megan Marsh
340363a649
Merge pull request #6613 from hashicorp/merge_ssh_config_funcs
Merge ssh config funcs from builders
2018-08-23 16:03:36 -07:00
Megan Marsh
1f79b430ee
Merge pull request #6610 from hashicorp/filter_logs
Filter logs
2018-08-23 13:30:21 -07:00
Adrien Delorme
41f6e0334d refactor all copy pasted sshConfig with into communicator.Config.SSHConfigFunc
* still need to append the auth methods into an array for gracefullness
2018-08-22 17:02:23 +02:00
Adrien Delorme
b038cd10f5 GCP: Allow to set MinCpuPlatform 2018-08-21 10:09:30 +02:00
Adrien Delorme
e37f126cf1 update gcp google.golang.org/api/compute/v1/ 2018-08-21 10:09:01 +02:00
Megan Marsh
ff6a039d5b replace scrubconfig with packer.LogSecretFilter.Set
filter winrm password from logs
Add new root-level packer template option, sensitive-variables, to tell us what user variables to mark sensitive.
2018-08-20 15:35:55 -07:00
deepuashokan85
10f118b14c
Update driver_gce.go
Added "rhel-sap-cloud" Projects_ID.
2018-05-31 11:29:57 +05:30
M. Marsh
e90c87f885
Merge pull request #6210 from hashicorp/add_windows_sql_cloud_to_defaults
add windows-sql-cloud to the list of projects to check for an image name
2018-05-01 12:57:10 -07:00
DanHam
5642f8cb01
Remove tmp files created by builder/googlecompute tests 2018-04-30 20:38:03 +01:00
Megan Marsh
ed6d999b1f add windows-sql-cloud to the list of projects to check for an image name 2018-04-27 11:24:08 -07:00
Richard Nienaber
db65c99bf4 update code based on master and update docs 2018-04-24 10:35:27 +01:00
Richard Nienaber
ec6f8264bf fix winrm password access in google compute 2018-04-16 10:56:26 +01:00
Seth Vargo
b17b333e29
Add a common package for specifying useragent and adopt that everywhere
There were 5 different formats for the Packer useragent string. This
fixes that and unifies it into a helper package.

I did not touch oracle's user-agent, because it looked kinda special.
2018-04-05 14:28:50 -04:00
Megan Marsh
414dd80e61
Merge pull request #6013 from jsoref/spelling
Spelling
2018-03-14 09:50:27 -07:00
Josh Soref
b81672c906 spelling: valid 2018-03-14 03:28:00 +00:00
Josh Soref
c563ef0797 spelling: structure 2018-03-14 03:23:56 +00:00
Evan Brown
7eda44d28c builder/googlecompute: disambiguate disable_default_service_account
This change requires 'disable_default_service_account=false' in order to
set 'service_account_email'.

This is a guard against an incorrect assumption
that disabling the default service account would mean that no service
account would be used.
2018-03-13 12:39:41 -07:00
Evan Brown
4a2c124ea2 builder/googlecompute: Optionally disable service account
The ability to use a service account other than the default was
introduced in #5928. This change adds to that by introducing the
'disable_default_service_account' config option. If true - and
'service_account_email' is not set - Packer will create a GCE VM
with no service account.
2018-03-07 20:53:26 -08:00
Christophe Courtaut
16882c1252 builder/googlecompute: Go code formatting 2018-02-22 17:19:13 +01:00
Christophe Courtaut
4befdce47e builder/googlecompute: Adds ability to specify service account
This commit allows user to specify the service account they want
to associate with the virtual machine provisionned by setting
the service_account_email field in the config.

It allows to manage permissions of the instantiated VM properly,
using a service account that can be tied up to IAM roles and
permissions.
2018-02-22 17:19:13 +01:00
Petr Hosek
eaef2961cb Support specifying licenses for Google Compute images
This is needed to enable features such as the nested virtualization:
https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances
2018-02-03 14:15:16 -06:00
Matthew Hooker
8cd403425e
test fixes WIP 2018-01-24 17:09:17 -08:00
Matthew Hooker
7a189a83a1
fix imports
`find . -type f -name '*.go' -not -path "./vendor/*" -exec goimports -w {} \;`
2018-01-24 17:09:17 -08:00
Matthew Hooker
a831d522be
change run signatures
Run now takes a context as well as a statebag. We'll assign the context
to the blank identifier to prevent namespace collisions. We'll let the
step authors opt-in to using the context.

`find . -iname "step_*.go" -exec gsed -i'' 's/func \(.*\)Run(/func \1Run(_ context.Context, /' {} \;`
2018-01-24 17:09:17 -08:00
Matthew Hooker
366dc3da0a
move multistep imports to helper.
gomvpkg -from "github.com/mitchellh/multistep" -to "github.com/hashicorp/packer/helper/multistep"
2018-01-24 17:09:15 -08:00
Matthew Hooker
ebe995c0ff
run goimports 2018-01-22 17:21:10 -08:00
Daniel Hess
f0299ba713 Adding GCE container optimized os image project 2017-11-12 00:45:22 -08:00
Evan Brown
13e0c232d4 builder/googlecompute: Test networking interpolation
This change pulls the logic that interpolates network and subnetwork
into its own func and adds tests.
2017-11-06 21:22:53 -08:00
Evan Brown
f2fed94a71 builder/googlecompute: Derive network and subnetwork IDs locally
This change constructs partial URLs for networks and subnetworks if they
are not already partial or full URLs (i.e., they do not contain a '/' in
their name). Network and subnetwork self-links are no longer retrieved
from the API.

Previously, if a user did not provide the network or subnetwork as a
fully-qualified URL (i.e., self-link), the builder would make
compute.(sub)networks.get API calls with the provided identifier to
discover the self-link. This requires the user or service account Packer
is using to have permission to describe those network resources, which
is becoming less common as IAM is used more. Specifically, a user may
have permission to launch a VM into a network/subnetwork, but will not
have permission to call APIs to describe network resources.
2017-11-06 16:41:42 -08:00
Evan Brown
bada7b73c1 builder/googlecompute: Selectively set default network
If a network is not specified, it should only be set to "default" if a
subnetwork is also not specified.
2017-11-06 16:41:42 -08:00
Evan Brown
1b3eb1c34d builder/googlecompute: Set default network_project_id
If network_project_id is not specified in the GCE builder config, it
should default to the project_id.
2017-11-06 16:41:42 -08:00
Megan Marsh
4721b48c70 add a couple of extra tests and reword documentation 2017-10-20 14:06:02 -07:00
Atsushi Ishibashi
c3a00993d0 Don't truncate and replace with 'a', update docs 2017-10-19 10:45:48 +09:00
Atsushi Ishibashi
3e68f1c505 Change first and last character when it doesn't match 2017-10-18 11:10:19 +09:00
Atsushi Ishibashi
210dd08326 Change args of NewConfig 2017-10-17 13:48:15 +09:00
Atsushi Ishibashi
5310d5629b Modify clean_image_name not defined error 2017-10-17 12:31:50 +09:00
Atsushi Ishibashi
3600924e59 Rename files 2017-10-17 04:55:50 +09:00
Atsushi Ishibashi
2da4e4c31d Change func name 2017-10-16 11:45:18 +09:00
Atsushi Ishibashi
caa6c9bf22 Add clean_ami_name for gcp 2017-10-16 00:53:18 +09:00
Peter Mounce
7cbd57faa6 Filling it back 2017-09-19 11:40:01 +01:00
Peter Mounce
15a456750b CI as compiler! 2017-09-19 11:34:08 +01:00
Peter Mounce
2239d55fdb Add test coverage 2017-09-19 11:31:05 +01:00
Peter Mounce
5bcb0644c3 Using CI for compilation errors because am on Windows 2017-09-18 18:13:21 +01:00
Peter Mounce
ac8eedf171 Introduce a new configuration parameter instead
... so that one can have a different list compared to instances.
2017-09-18 17:53:40 +01:00
Peter Mounce
e579b947b1 Fix signature that I missed 2017-09-18 17:34:06 +01:00
Peter Mounce
8789ae72e8 Make the googlecompute builder label the resulting image.
... so that it's possible to find images matching particular characteristics more easily.
2017-09-18 15:44:01 +01:00
Patrick Decat
a7283f2281 Add support for setting labels on GCE instance 2017-09-06 10:58:08 +02:00
Megan Marsh
3974976518 Merge pull request #5137 from vilkaspilkas/f-googlecompute-accelerator
Add accelerator api support to googlecompute builder
2017-09-01 14:12:26 -07:00
Matthew Hooker
9b88ec975a Merge pull request #5227 from hashicorp/fix-flaky-test
fix test that flaked in a travis build recently
2017-08-08 12:28:33 -07:00
Megan Marsh
3f7c090f3b fix test that flaked in a travis build recently 2017-08-08 12:25:12 -07:00
Dan Isla
00797cc23b Update to how zone is extracted from metadata 2017-07-29 08:20:58 -07:00
Saulius Grusnys
5ebc96744d Accelerator api is now GA, switching back to v1 from v0.beta 2017-07-21 15:05:24 +01:00
Saulius Grusnys
b6783a1180 Adding sanity checks in Prepare when adding accelerators and tests for accelerator configuration 2017-07-19 11:28:49 +01:00
Saulius Grusnys
200113b8c1 Switch googlecompute builder to use compute/v0.beta and add support for accelerator api 2017-07-17 15:39:41 +01:00
Rickard von Essen
f230f00726 googlecompute: Allow using URL's for network and subnetwork
If full server URL's is used in subnetwork we can skip reading from the network
API. This is usefull when you can launch instances in a shared network but don't
have access to do GET on the network resources.

Closes: #5018
2017-06-27 21:58:21 +02:00
Matthew Hooker
94d7a4ce8d
post-processor/vagrant-cloud: try upload once
* fixes multiple uploads mentioned in #4973
* removed unused token code
2017-06-12 17:34:32 -07:00
Matthew Hooker
ee5d13611f
update ssh client usage for new crypto/ssh version 2017-05-18 12:01:44 -07:00
Matthew Hooker
81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Matthew Hooker
bce03492d9
remove references to ServiceAccountEmail 2017-04-03 11:22:00 -07:00
Rickard von Essen
77dc8b84c1
builder/googlecompute: Revert to using default service account
Fixes issue with cross Project builds.

Closes #4608

Regression introduced in PR #3639
2017-04-02 17:52:14 +02:00
Matthew Hooker
d1b20b3d9c
remove a bunch of dead code.
https://github.com/dominikh/go-tools/tree/master/cmd/unused
2017-03-28 20:36:20 -07:00
Rickard von Essen
eac5b6392d googlecompute: Correct values for on_host_maintenance
If preemptible is true then on_host_maintenance must be TERMINATE.

Also corrected order in docs.

Closes #4620
2017-03-08 19:44:07 +01:00
Matthew Hooker
2381bfa8ad Merge pull request #4518 from AlexLov/bugfix_image_family
[googlecompute] fix bug of creating image from custom image_family
2017-02-21 10:58:23 -08:00
Dimitri Rudnev
2009fcd9df OnHostMaintenance, googlecompute updating documenation , additional option for validation and setting defaults 2017-02-10 11:57:15 -08:00
Dimitri Rudnev
bab590c177 Adding OnHostMaintenance option for googlecompue builder 2017-02-10 10:58:57 -08:00
Alex Lov
cfa8f8c215 fix bug of creating image from custom image_family 2017-02-08 22:50:19 +03:00
Troy Toman
12f279fa79 add ability to set a different project-id for a network in the googlecloud builder 2016-12-02 15:22:36 -06:00
Rickard von Essen
6947a74151 Merge pull request #4162 from classmarkets/google-source-image-family
builder/googlecompute: support source image family
2016-11-26 17:26:47 +01:00
Rickard von Essen
d18da5e679
Added printout of select source_image 2016-11-26 15:06:43 +01:00
Rickard von Essen
96e9a8e6e9 Removed default value for ssh_username 2016-11-17 22:30:34 +01:00
Peter Schultz
bcb319640e builder/googlecompute: support source image family
Closes #4100
2016-11-13 16:54:04 +01:00
Matthew Hooker
5d0892bd37 Merge pull request #4101 from lwander/f-googlecompute-ssh-private-key-file
builder/googlecompute: Use ssh_private_key_file if provided
2016-11-03 11:04:02 -07:00
Lars Wander
583e341ae7 builder/googlecompute: Store empty public_key 2016-11-03 12:49:09 -04:00
Lars Wander
7f474d8f78 builder/googlecompute: Tests added 2016-11-03 12:45:52 -04:00
Scott Crunkleton
85210afe92 googlecompute: conditionally omit the wait for startup script step if no startup script is provided. 2016-11-02 15:20:21 -07:00
Lars Wander
d70e783455 builder/googlecompute: Use ssh_private_key_file if provided
This seemed to be missing from the googlecompute provider. Now if the
ssh_private_key_file is provided, that will be used in place of a temporary
key. I didn't update the googlecompute specific docs under `./website/`, since
this parameter is already documented under the communicators templates page.
2016-11-02 17:04:34 -04:00
Matthew Hooker
d920b3fbf4 run gofmt 2016-11-01 14:08:04 -07:00
YAMADA Tsuyoshi
da7d317e46 googlecompute: Run instance with custom scopes 2016-10-22 15:46:14 +09:00
Rickard von Essen
924c0bc461 Merge pull request #3932 from pieter-lazzaro/googlecompute-createpassword
GCE Windows instance password creation
2016-09-30 22:01:56 +02:00
Rickard von Essen
c0a4067151
builder/googlecompute: Print out WinRM password in debug mode. 2016-09-30 21:17:38 +02:00
Matthew Hooker
a8e57d83d2 gofmt project.
noticed many unrelated changes being added to patches because of gofmt.

ran `find . -not -path "./vendor/*" -name "*.go" -exec gofmt -w {} \;`
2016-09-29 14:13:06 -07:00
Matthew Hooker
a9abe43325 builder/amazon: add retry login when creating tags.
also move Retry from builder/googlecompute/common to common/retry
2016-09-28 18:22:31 -07:00
Pieter Lazzaro
5db1c1f503 Create a password for windows instances when using WinRM communicator and no password is provided. 2016-09-27 18:42:34 -04:00
Valentin Tjoncke
ef1517064c googlecompute/builder: Always show message when checking image exists 2016-09-24 21:12:25 +02:00
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
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
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
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
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
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
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
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
Chris Bednarski
2f0e1218dc Move regexp to package scope so it will be validated by the compiler instead of at runtime 2016-05-13 15:37:25 -07:00
Peter Schultz
a99a417db9 builder/googlecompute: validate image_family 2016-05-13 15:24:02 -07:00
Peter Schultz
8546aafec5 builder/googlecompute: support image family 2016-05-13 15:24:02 -07:00
Christopher Boumenot
2d1347c1ec Insert Packer's version into the User Agent. (#3465) 2016-05-05 13:10:55 -07:00
Chris Bednarski
1b1bbb604e Merge branch 'googlecompute-disk-type' of https://github.com/meatballhat/packer into f-google-disk-type 2016-03-10 14:51:30 -08:00
Chris Bednarski
4458de4ea0 Reformat 2016-02-11 23:53:40 -08:00
Matt Morrison
daf57c7632 Add tests and documentation for subnetwork attribute 2016-02-11 21:54:48 +13:00
Matt Morrison
942aaa7a85 Add support for Google subnetworks. Closes #3062. Fixes an issue with how packer populates instances metadata. Closes #3181 2016-02-11 17:31:46 +13:00
Ryan Uber
7732cf45a0 builder/googlecompute: fix image name defaults 2016-01-19 11:12:19 -08:00
Caius Howcroft
069c3c21b1 Added support for GCE external static IPs 2015-12-24 19:15:41 -06:00
YAMADA Tsuyoshi
18d79cfb3d added test 2015-12-05 15:48:07 +09:00
YAMADA Tsuyoshi
afd314959b supported preemptible in googlecompute builder 2015-12-05 05:13:35 +09:00
Dan Buch
cac93d311c builder/googlecompute: accept disk type, default pd-standard 2015-10-13 20:18:26 -04:00
Dave Cunningham
1fea962a3a account_file can be verbatim JSON string 2015-10-08 02:40:18 -04:00
Rickard von Essen
9cf99289c5 Fixed GCE builder after dependency change.
See
4af91da601
2015-09-20 10:14:07 +02:00
Chris Bednarski
32b714e085 Update code.google.com/gosshold/ssh to point to golang.org/x/crypto/ssh, since this has been moved into core now
Fixes #2515
2015-07-30 19:19:59 -07:00
Chris Bednarski
1c71eaaa91 Change panic to multierror 2015-07-07 17:12:21 -06:00
Chris Bednarski
775450f46a Merge branch 'fix_gce_image_name' of https://github.com/samitpal/packer into b-google-image-name 2015-07-07 16:19:55 -06:00
Chris Bednarski
bd6c31c2d9 Added TestImageName and moved private methods to the bottom of the file 2015-07-07 16:18:31 -06:00
Samit Pal
6d6b3e1ac2 The default image name in the code has a bug. It is being set to packer-{{timestamp}}, the {{timestamp}} part needs to be interpolated. Without the interpolation the GCE builder fails with
the following error

==> googlecompute: Creating image...
==> googlecompute: Error waiting for image: googleapi: Error 400: Invalid value for field 'resource.name': 'packer-{{timestamp}}'. Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)', invalid
2015-07-07 05:27:58 +00:00
Mitchell Hashimoto
6c7a7b6068 builder/googlecompute: default SSH settings properly [GH-2340] 2015-06-29 09:56:33 -07:00
Mitchell Hashimoto
84189f7a28 builder/*: properly save interpolation context 2015-06-22 09:22:42 -07:00
Mitchell Hashimoto
9bb7d0a2d5 Merge pull request #2152 from abayer/gce-optional-internal-ip
builder/google: Adds support for using the internal IP rather than NAT IP in GCE
2015-06-18 10:15:27 +02:00
Mitchell Hashimoto
115d583cff helper/communicator: make host more generic 2015-06-13 19:23:33 -04:00
Mitchell Hashimoto
502076c92e builder/googlecompute: use helper/comm 2015-06-13 18:30:16 -04:00
Mark Peek
f398352996 Fix a bug where interpolation was broken in some builders 2015-06-12 14:00:59 -07:00
Mitchell Hashimoto
23a48d6619 go fmt 2015-06-08 21:34:20 -07:00
Mitchell Hashimoto
9dff0adfb1 builder/google: don't hardcode SSH timeout [GH-1781] 2015-06-08 21:13:25 -07:00
Andrew Bayer
ebdd0d991a Adds support for using the internal IP rather than NAT IP in GCE 2015-05-29 14:50:11 -07:00
jszwedko
b1497b951c code.google.com/p/go.crypto/ssh -> golang.org/x/crypto/ssh
code.google.com/p/go.crypto/ssh is now at golang.org/x/crypto/ssh as of
https://code.google.com/p/go/source/detail?spec=svn.crypto.69e2a90ed92d03812364aeb947b7068dc42e561e&repo=crypto&r=8fec09c61d5d66f460d227fd1df3473d7e015bc6

Using the code.google.com import redirects properly, but runs into
issues if you try to use a subpackage of `ssh`, e.g. `agent` which
refers to golang.org/x/crypto/ssh causing conflicts if your types expect
code.google.com/p/go.crypto/ssh.

This is a precursor to a PR for #1066.
2015-05-28 08:17:49 -07:00
Mitchell Hashimoto
5aa30caa64 builder/googlecompute: new interpolation 2015-05-27 12:57:48 -07:00
duftler
6d28ee931c Delete GCE disk on SIGINT. 2015-04-21 18:02:05 +00:00
Dave Cunningham
982934dfb9 Use new Google API and OAuth libs, add UserAgent string 2015-04-17 15:12:39 -04:00
Emil Hessman
002e50f493 builder/googlecompute: fix formatting directives
Fixes the following vet reports:

builder/googlecompute/step_create_instance_test.go:42: possible formatting directive in Fatal call
builder/googlecompute/step_teardown_instance_test.go:29: possible formatting directive in Fatal call
builder/googlecompute/step_teardown_instance_test.go:39: possible formatting directive in Fatal call
2015-02-25 05:29:53 +01:00
Ross Smith II
10dee1bd68 Temporarily fix build by forking golang.org/x/oauth2 @ b3f9a68 2014-12-21 11:22:24 -08:00
Eric Johnson
24a774f0d3 Merge pull request #1737 from dcarlino/failfast_gce
Check if image already exists before doing anything else on GCE.
2014-12-09 12:10:05 -08:00
Dustin Carlino
fe47f45800 Remove bucket_name from GCE config.
Fixes #1732. Forgot to do this in 23c947acf0.
2014-12-09 08:44:01 -08:00