332 Commits

Author SHA1 Message Date
Megan Marsh
a87ce366b3
Merge pull request #7835 from hashicorp/google_oauth
replace some bespoke google auth code with code from golang's oauth2 …
2019-07-08 09:48:27 -07:00
Megan Marsh
617fd18255 supply complete dummy data for googlecompute tests 2019-07-03 15:58:08 -07:00
Megan Marsh
0dfb3cc56f replace some bespoke google auth code with code from golang's oauth2 library 2019-07-03 14:27:33 -07:00
Megan Marsh
c03c3f4410 replace duplicate commHost functions with a single communicator helper that checks for ssh_host and does a statebag lookup for a given key 2019-07-03 13:30:29 -07:00
Megan Marsh
eb8c74bf85 allow ssh_host config option to override host logic for all builders 2019-07-02 13:56:28 -07:00
Megan Marsh
ad8a88e366 allow ssh_host to override the host ip gathered from the instance for GCP builder 2019-07-02 13:01:41 -07:00
Adrien Delorme
a3e3c313a9 docs: use partials in googlecompute after master merge 2019-06-12 15:18:39 +02:00
Adrien Delorme
6e3dc1aa9a Merge remote-tracking branch 'origin/master' into scrape_doc_to_builder_struct_config 2019-06-12 14:28:11 +02:00
Pratyush singhal
92af5847a7 refactor: replace *packer.MultiError from type signature of createInstanceMetadata with generic error interface
Signed-off-by: Pratyush singhal <psinghal20@gmail.com>
2019-06-11 21:01:26 +05:30
Pratyush singhal
6ce6bd8ad3 refactor: add multiError in createInstanceMetadata method to capture multiple errors
Signed-off-by: Pratyush singhal <psinghal20@gmail.com>
2019-06-11 20:09:14 +05:30
Pratyush singhal
4a369b4ef1 chore: add test for MetadataFiles option
Signed-off-by: Pratyush singhal <psinghal20@gmail.com>
2019-06-11 17:45:30 +05:30
Pratyush singhal
99a3e9cf0a chore: update tests for createInstaceMetadata
Signed-off-by: Pratyush singhal <psinghal20@gmail.com>
2019-06-11 16:47:16 +05:30
Pratyush singhal
529dff0abb refactor: add error handling in createInstanceMetadata method
Signed-off-by: Pratyush singhal <psinghal20@gmail.com>
2019-06-11 16:36:16 +05:30
Adrien Delorme
4399684372 make fmt autogenerated docs 2019-06-06 16:29:25 +02:00
Pratyush singhal
1e1af35341 refactor: replace userdata_files with generic metadata_files map
Signed-off-by: Pratyush singhal <psinghal20@gmail.com>
2019-06-06 16:14:57 +05:30
Pratyush singhal
3845186c4c feat: add feature to import user-data from a file
Signed-off-by: Pratyush singhal <psinghal20@gmail.com>
2019-06-06 11:28:59 +05:30
Adrien Delorme
e6cbb013ba add // go:generate struct-markdown to all previously edited files 2019-06-05 16:42:18 +02:00
Adrien Delorme
f1917edd34 generate the comments for config struct of builders scraping doc website 2019-06-05 16:42:17 +02:00
krisko
e96bda6466
Remove config interface. Make CreateImage function to accept config as list of config fields 2019-05-05 17:17:08 +02:00
krisko
f1e9664012
Googlebuilder: Add image key encryption 2019-05-02 17:37:43 +02:00
krisko
9b39e3f928
GCP builder add image encryption support 2019-05-02 17:37:36 +02:00
Adrien Delorme
d72040f4fa move retry code into the common/retry pkg and make retry context aware 2019-04-09 17:46:38 +02:00
Adrien Delorme
a81abd297b Merge remote-tracking branch 'origin/master' into context_provisioner 2019-04-08 20:09:01 +02: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
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 b35acbd8798a1baa645f0d181731a9cd9318a61c.
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