65 Commits

Author SHA1 Message Date
Adrien Delorme
819329228a Change back to make sure all durations are a time.Duration
It is simply the best/simplest solution and trying to prevent users from passing and integer here would be like opening a can of worms. Because:

* we cannot make mapstructure validate our duration string ( with an UnmarshalJSON func etc.)
* we cannot make mapstructure spit a string instead of a duration and packer will decode-encode-decode config.
* the hcl2 generated code asks for a string, so this will be enforced by default.
2019-10-31 16:12:07 +01:00
Adrien Delorme
bf3d9841c6 Force durations to be passed a strings
Before this commit it was possible to set a duration using an integer or a float. Go's time.Duration is an int64 internally an mapstructure will take advantage of this and load the number as a int64 but `1` means one ns which is unexpected/confusing. To avoid confusion and enforce readability this forces users to pass a string with a unit for a duration; ex "56s".
2019-10-31 11:47:19 +01:00
Adrien Delorme
078ba7c8c3 commit old code generation tool
for history
2019-10-15 12:56:42 +02:00
Adrien Delorme
3fe9d52e3f Merge remote-tracking branch 'origin/master' into scrape_doc_to_builder_struct_config 2019-09-20 11:15:44 +02:00
Daniel Kimsey
3b64620234 SSH tunneling support
Support for both local and remote TCP port tunneling. Includes updated
docs and tests.

Does not implement dynamic port forwarding (SSH's built-in SOCKS)
(uncertain difficulty) nor unix socket (potentially easy).
2019-09-18 11:09:41 -07:00
Adrien Delorme
5517d41468 make sure all documentation fields are there
* add missing `temporary_key_pair_name` field for alicloud
* add missing description to `vpc_filter` for aws
* add missing ssh communicator fields for aws
* add links for aws
* update vmware-vmx docs
* manually describe AMI Configuration section for ebsvolume
* display missing required ami_name field for aws
* add missing fields for docker
* add missing fields for openstack
2019-08-26 17:16:54 +02:00
Adrien Delorme
4cb7c30987 Merge remote-tracking branch 'origin/master' into scrape_doc_to_builder_struct_config 2019-08-21 16:44:23 +02:00
Megan Marsh
6ad975f296 Revert "move SSHInterface/SSHIPVersion fields to communitator.Config struct"
This reverts commit b0c09087a21993890e4eca52c07a85c572097aea.
2019-07-02 10:46:10 -07:00
Adrien Delorme
4bf6a56d71 split communitacor.SSH & communitacor.WinRM to facilitate documentation
put doc for communicator into the struct
2019-06-06 16:55:24 +02:00
Megan Marsh
8f3313d81e Create new docker communicator for windows containers 2019-03-27 15:25:32 -07:00
Megan Marsh
31c8acc5bc add a configurable pause before step_connect to work around bootstrap race conditions 2019-02-15 15:05:29 -08:00
Ali Rizvi-Santiago
040a33567e Trying again one more time to prevent import cycles.. Moved common.ExpandUser into packer.ExpandUser.. 2018-12-04 16:54:47 -06:00
Ali Rizvi-Santiago
79b68fb89c Replaced the previous incorrect logic with an re-implementation of common.ExpandUser. 2018-12-04 16:53:33 -06:00
Ali Rizvi-Santiago
e04986659a Changed the logic for when to actually prefix a path with a u.HomeDir so that it's only done when a non-absolute path is specified. 2018-12-04 16:53:33 -06:00
Ali Rizvi-Santiago
1a3c3f2ffc Replaced all instances of mitchellh/go-homedir with an implementation based on os/user. 2018-12-04 16:53:33 -06:00
Mikhail Ushanov
ee0bff6451 communicator/ssh: proper error message
Signed-off-by: Mikhail Ushanov <gm.mephisto@gmail.com>
2018-11-08 14:25:50 +03:00
Mikhail Ushanov
45925657fc communicator/ssh: make ssh keys payload internal
Signed-off-by: Mikhail Ushanov <gm.mephisto@gmail.com>
2018-11-08 14:25:50 +03:00
Mikhail Ushanov
1c503b86d9 communicator/ssh: expand user path for bastion private key
Signed-off-by: Mikhail Ushanov <gm.mephisto@gmail.com>
2018-11-08 14:25:50 +03:00
Mikhail Ushanov
6d2a0ab0df communicator/ssh: expand user path for private key
Signed-off-by: Mikhail Ushanov <gm.mephisto@gmail.com>
2018-11-08 14:25:50 +03:00
Mikhail Ushanov
da0bad8441 communicator/ssh: add private key file read helper
Signed-off-by: Mikhail Ushanov <gm.mephisto@gmail.com>
2018-11-08 14:25:50 +03: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
Adrien Delorme
b0c09087a2 move SSHInterface/SSHIPVersion fields to communitator.Config struct 2018-08-29 14:51:28 +02:00
Adrien Delorme
1d219cecaf add SSHTemporaryKeyPairName to communicator.Config 2018-08-29 14:40:33 +02:00
Adrien Delorme
9a9b82715b config.Comm.SSHKeyPair => SSHKeyPairName 2018-08-29 14:40:33 +02:00
Adrien Delorme
77a57f0354 communicator.Config: mapstructure:"ssh_key_pair" => ssh_keypair_name 2018-08-29 14:40:33 +02:00
Adrien Delorme
69dfe2565b SSHBastionPrivateKey => SSHBastionPrivateKeyFile 2018-08-29 14:40:33 +02:00
Adrien Delorme
5369c15459 helper: communicator.SSHFileSigner => ssh.FileSigner
* had to to avoid circular dependency
* this commit fixes #6631 ( esxi cannot be reached by ssh )
2018-08-29 14:40:33 +02:00
Adrien Delorme
b83c72fd54 more private keys in config 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
Adrien Delorme
bacfb02182 doc better SSHConfigFunc 2018-08-22 18:16:25 +02:00
Adrien Delorme
ab7f998862 SSHConfigFunc: use struct fields instead of copying them locally 2018-08-22 17:08:46 +02:00
Adrien Delorme
0ff7c1da87 SSHConfigFunc: append the ssh auth ways 2018-08-22 17:03:25 +02:00
SwampDragons
5af42ee9e2
Revert "Add winrm_no_proxy option." 2018-02-08 15:10:53 -08:00
Matthew Hooker
22666153f9
Add winrm_no_proxy option.
Setting this adds the remote host:ip to the `NO_PROXY` environment
variable.
2018-02-07 20:58:08 -08:00
Matthew Hooker
63f1673909
ssh deadlines 2018-01-31 12:35:25 -08:00
Matthew Hooker
cab52872f4
add session level keep-alives for ssh communicator 2018-01-30 22:00:37 -08:00
Pawel Kilar
17beb1d7ad Check if both SSH proxy and basiton are configured 2017-10-14 21:38:44 +01:00
Paul Kilar
d9b404fa00 SOCKS5 proxy support 2017-10-10 15:04:15 +01:00
Rickard von Essen
4f6010aa26
ssh: Renamed ssh_disable_agent to ssh_disable_agent_forwarding
Closes: #4941
2017-06-19 16:26:18 +02:00
Lee Spottiswood
8473a1148c Add 'winrm_use_ntlm' configuration directive for NTLM authentication support 2017-06-07 12:08:12 +01:00
Rickard von Essen
2164700162
comm/ssh: Add support for using SSH Agent auth towards a bastion host.
Adds `ssh_bastion_agent_auth`

Fixes: #4732
2017-05-28 14:05:03 +02:00
Matthew Hooker
81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Eike Verdenhalven
7ad77b9e93 integrate new winrm transport interface 2017-01-18 22:11:48 +01:00
Rickard von Essen
96e9a8e6e9 Removed default value for ssh_username 2016-11-17 22:30:34 +01:00
James Nugent
7425fef2c7 builder/amazon: Allow use of local SSH Agent
This commit adds an option to use the local SSH Agent to authenticate
connections to source instances started by the the EBS and Instance
Store builders.

This is of use when the source AMI _already_ has configuration for
authorized SSH keys - for example if one uses an SSH certificate
authority.

A further extension (not implemented in this commit) is to allow SSH
agent use with a pre-defined key pair, in order to allow keys with
passphrases to be used without giving the passphrase to Packer.
2016-10-23 21:43:47 -05: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
Christopher Boumenot
b57ed27352 Add support for NTLM the WinRM communicator.
WinRM exposes an HTTP transport decorator that can be used for different
authentication schemes.  Windows on Azures requires this if one is to use
the out of the box configuration.
2016-03-10 10:53:38 -08:00
Ilias Bertsimas
85e4865368 Make communicator's WinRM defaults more intuitive when using SSL. 2016-02-29 14:26:28 +00:00
Chris Bednarski
3d9410f176 Merge branch 'sftp' of https://github.com/2opremio/packer into f-sftp 2016-02-02 14:16:19 -08:00