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
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
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
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 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