Commit Graph

29 Commits

Author SHA1 Message Date
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 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
Adrien Delorme 51d2aac9f6 SSHPrivateKey => SSHPrivateKeyFile 2018-08-29 14:40:32 +02:00
Adrien Delorme 6bbcd3e914
Remove remaining unused ssh config funcs and add missing calls (#6622)
* Remove duplicate unused SSHConfig funcs

* call to SSHConfigFunc() for azure/arm builder

* ncloud too

* remove empty ncloud file
2018-08-24 16:00:40 +02: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
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
Matthew Hooker 6581e0b7d6
add hostkeycallback everywhere else 2017-06-21 12:00:34 -07:00
Anish Bhatt ff39827733
Make null builder actually have the ability to do nothing 2017-06-07 17:11:42 -07:00
Rickard von Essen 2f8b02a6e1
builder/null: Support SSH Agent Auth 2017-06-02 12:55:31 +02:00
JD Friedrikson a0052fdb68
Specify InsecureIgnoreHostKey for HostKeyCallback
[A recent breaking change upstream in Golang's crypto
library](e4e2799dd7)
has broken SSH connectivity for a few builders:

```
==> qemu: Waiting for SSH to become available...
2017/05/20 16:23:58 ui: ==> qemu: Waiting for SSH to become available...
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 [INFO] Attempting SSH connection...
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 reconnecting to TCP connection for SSH
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 handshaking with SSH
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 handshake error: ssh: must specify HostKeyCallback
2017/05/20 16:23:58 packer: 2017/05/20 16:23:58 [DEBUG] SSH handshake err: ssh: must specify HostKeyCallback
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 [INFO] Attempting SSH connection...
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 reconnecting to TCP connection for SSH
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 handshaking with SSH
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 handshake error: ssh: must specify HostKeyCallback
2017/05/20 16:24:05 packer: 2017/05/20 16:24:05 [DEBUG] SSH handshake err: ssh: must specify HostKeyCallback
```

Specifying HostKeyCallback as insecure should make things work again
and would make sense for packer's use case.
2017-05-20 16:17:04 -04:00
Matthew Hooker 81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Rickard von Essen 96e9a8e6e9 Removed default value for ssh_username 2016-11-17 22:30:34 +01: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
Gonzalo Peci 9c9f8cd451 Add winrm functionality to null provisioner (#2525)
* Add new functions to communicator helper to return the user, password, host, based on the communicator used.

This implementation can help then generalize the provisioeners later on.

* Update null builder checks to utilize the new functions and check for ANY hostname or user or password

* Update builder to user any hostname
2016-05-18 17:22:53 -07:00
Sunil K Chopra 750e09d51d should be ssh_host, not host 2015-07-07 17:04:27 -05:00
Mitchell Hashimoto 115d583cff helper/communicator: make host more generic 2015-06-13 19:23:33 -04:00
Mitchell Hashimoto 68e4734caf builder/null: pass unit tests 2015-06-13 18:55:37 -04:00
Mitchell Hashimoto d545431f9b builder/null: adopt helper/communicator 2015-06-13 17:42:43 -04:00
Mitchell Hashimoto f1cef0baae builder/null: fix config parsing 2015-06-13 14:08:33 -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
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 31bdb4853c builder/null: interpolations 2015-05-27 12:59:14 -07:00
Julian Phillips 90a57c411f Expand Artifact API to expose build state
In order that something consuming an artifact can have access to extra
builder specific data add the State method which allows the caller to
ask for arbitary values by name.
2014-09-22 11:15:47 +01:00
Florian Noeding de29431a43 null-builder: added support for templating 2014-07-17 17:46:22 +02:00
Mitchell Hashimoto 65804c07c5 builder/null: pass SSH tests 2014-04-26 11:28:02 -07:00
Ross Smith II db96a79bf4 use code.google.com/p/gosshold/ssh 2014-04-21 08:18:19 -07:00
Florian Noeding b879ec85cc implemented null buider
The null builder is not really a bulider, it just setups a SSH
connection and runs the provisioners. It can be used to debug
provisioners without incurring high wait times. It does not create any
kind of image or artifact.
2014-03-24 11:26:10 +01:00