Commit Graph

162 Commits

Author SHA1 Message Date
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