Commit Graph

298 Commits

Author SHA1 Message Date
Megan Marsh f8f1ebf0c7 move version and useragent definitions into sdk 2020-11-18 11:42:02 -08:00
Megan Marsh 9e47696dff move helper/config to bundle with the other template definitions 2020-11-18 10:34:59 -08:00
Megan Marsh 007337989e move communicator helpers into communicator dir 2020-11-18 10:24:25 -08:00
Megan Marsh 3f6deb8828 move multistep into the plugin sdk 2020-11-17 16:31:03 -08:00
Megan Marsh 8350ade7ef
Merge pull request #10266 from hashicorp/command_flags
Move flag packages from helper to command
2020-11-17 10:59:07 -08:00
Megan Marsh 7d658149ea update tests and website and generated partials to reflect new package format 2020-11-17 10:36:01 -08:00
Megan Marsh 1ffc358ada move tmp helper func into packer-plugin-sdk 2020-11-16 15:13:08 -08:00
Megan Marsh 6a1a22151c move the various flag packages from helper to command, since command is the only package that uses them. 2020-11-16 14:23:35 -08:00
Megan Marsh efe11da4a3
Merge pull request #10254 from hashicorp/plugin-sdk-2
Plugin sdk 2
2020-11-16 11:29:20 -08:00
Megan Marsh 220bca460e
Merge pull request #10253 from hashicorp/plugin-sdk-1
Plugin sdk 1
2020-11-16 11:13:59 -08:00
Megan Marsh 3e54e9ea80
Merge pull request #10235 from hashicorp/refactor_version_code
Refactor version code
2020-11-16 11:12:59 -08:00
Megan Marsh 6402362018 create packer-plugin-sdk directory and begin moving the relevant folders into it. 2020-11-13 10:47:36 -08:00
Megan Marsh df9febef1b move communicators into sdk-internals directory 2020-11-13 10:44:07 -08:00
Wilken Rivera 67e2c0b83c
Add nullStep as return for multistep.If (#10247)
This change introduces a new nullStep type that can be used in place of
a nil step. This fixes an issue where multistep.If would return a nil
step if the condition was not met causing a builder to crash when
executed using `-on-error=ask` or `-on-error=abort`.

Closes #10241
2020-11-12 11:26:54 -05:00
Megan Marsh 3db40194af version files 2020-11-10 14:48:06 -08:00
Megan Marsh 1ecd715221 refactor code so that packer/version is not a dependency of sdk code or plugin code 2020-11-09 17:20:42 -08:00
Megan Marsh cd59d938b2 refactor core version pkg imports out of json interpolation/decode pathway. 2020-11-09 13:20:36 -08:00
Megan Marsh 2d90ffe7a4 move GeneratedData struct and PlaceholderMsg to same package under common 2020-11-06 10:45:38 -08:00
Megan Marsh 45b5f0c2ee move custom http client creation with env proxy args into same package as other network related helpers 2020-11-04 14:51:14 -08:00
Megan Marsh 7b57e28600 move localexec to common/shell-local dir since it is related to shelling out locally 2020-11-04 11:56:46 -08:00
Adrien Delorme f5e037e8b4 Merge remote-tracking branch 'origin/master' into azr_selectable_temp_keygen_type_gcp 2020-10-26 15:47:29 +01:00
Adrien Delorme b4f68767a3 make default key type RSA instead of DSA 2020-10-26 15:45:06 +01:00
Megan Marsh 70cb4097e1 review comments, add plugin type for a few missing builders 2020-10-21 16:17:32 -07:00
Megan Marsh c0ce8a9414 rework fixer deprecation code so we know what plugins they relate to 2020-10-21 15:28:59 -07:00
Adrien Delorme 4aea2efd0f HCL2: fully name SSHTemporaryKeyPair fields so that they don't conflict and can be generated 2020-10-21 11:53:07 +02:00
Adrien Delorme d1e0214bec avoid panic debugging ssh key 2020-10-20 16:59:46 +02:00
Adrien Delorme b24911661f
add sshkey package and ssh-keygen comand (#10101)
* add sshkey.Generate function that returns an sshkey.Pair to be used with openssh.
* add cmd/ssh-keygen/main.go for testing purposes
* add a test calling ssh.ParsePrivateKey & ssh.ParseAuthorizedKey (which is very
   similar to what openssh would do to read a keypair)

The wrapping of the keys should be handled by crypto/x509.MarshalPKCS8PrivateKey 
& x/crypto/ssh.NewPublicKey which does not work for ed25519 and dsa. 
x509.MarshalPKCS8PrivateKey marshals ed25519 keys but the keys did not work with openssh. 
x509.MarshalPKCS8PrivateKey does not handle dsa keys.
So I had to 'wrap' those manually by reading the code of the openssh package.
Note that ssh.NewPublicKey works with any keytype. I should probably do a PR to ssh to have a NewPrivateKey & Marshalling funcs
2020-10-19 10:24:34 +02:00
Adrien Delorme 54032d6c11 gen code and docs 2020-10-15 16:51:23 +02:00
Adrien Delorme f4f731b83c Refactor google compute's temporary ssh keygen genertion to use the sshkey package 2020-10-15 16:51:11 +02:00
Adrien Delorme 5b7037c069 add more comments 2020-10-14 16:01:41 +02:00
Adrien Delorme fe8d287036 some linting 2020-10-14 15:54:51 +02:00
Adrien Delorme c5d6e72720 comment PairFromED25519 2020-10-14 13:21:46 +02:00
Adrien Delorme 766e7872a0 add a comment for DSA default bits setting 2020-10-14 13:17:53 +02:00
Adrien Delorme 77adeb1191 create PairFromED25519 func to create valid ed25519 keypairs 2020-10-14 13:12:17 +02:00
Adrien Delorme 3712cd8e2c bump default RSA bits to 4096 2020-10-13 17:50:43 +02:00
Adrien Delorme 9b68099ad5 remove specific EC code 2020-10-13 16:27:59 +02:00
Adrien Delorme 48199c5aa8 add basic test to see if generated files are parseable 2020-10-13 16:25:24 +02:00
Adrien Delorme ca23dab943 set correct type for PEM block 2020-10-13 12:43:21 +02:00
Adrien Delorme 750102901c add cmd/ssh-keygen/main.go to try this on real servers 2020-10-13 11:25:52 +02:00
Adrien Delorme 0cf7af4247 add sshkey.Generate function 2020-10-12 18:04:02 +02:00
Ricardo Rosales 809f38be3a
[azure-chroot] Updating parameter `exlude_from_latest` to `exclude_from_latest` (#10034) 2020-10-07 11:08:33 +02:00
Marco Molteni 4d7e42220b
scaleway: add pre validate step (check image and snapshot names) (#9840)
* Implement Stringer inteface for multistep.StepAction

* scaleway: add pre validate step (check image and snapshot names)

Before, it was possible to create multiple images with the same name,
leading to a confusing and wasteful situation (same for snapshots).

Now, we perform the same kind of checks done by the AWS EC2 builder,
and refuse to proceed if there is an existing image with the same name
(same for snapshots).

As usual, invoking `packer build -force` will bypass the checks.

Closes #9839.
2020-09-18 15:37:48 -04:00
Megan Marsh 94a9beaac6 fix up documentation for virtualbox key pair ssh options 2020-09-04 16:55:58 -07:00
Megan Marsh 5120ad9d9a add test file 2020-09-04 11:56:32 -07:00
Megan Marsh 20d62654ae move runAndStream into a generalized helper function to enable easy local exectution in other places than just the docker builder 2020-09-04 11:56:32 -07:00
Megan Marsh 2dcf950441 change pause to run connect again afterwards 2020-08-14 11:23:43 -07:00
Adrien Delorme 44616d3bff
refactor initialization out from packer configs + tests (#9627)
The initialization of packer core in JSON also validates that `null` variables were set, except in the case of `packer validate --syntax-only` , but after the refactor to allow to have all commands work with HCL2 and JSON this subtlety was lost.

This refactors the initialisation of the core in order to allow to have `packer validate --syntax-only` not error in case a variable is not set. Since these calls are refactored this works for HCL2 too.

fix #9478
2020-07-24 10:58:03 +02:00
Megan Marsh a687d6fe12
ci/tech-debt: Fix vmware acceptance tests (#9636)
* add kex algorithm option to ssh config

* regenerate code

* This commit fixes old vmware acceptance tests that have not been run in some time. It does this in two parts:
1) It modifies the minimal vmware build configuration to use a custom kex algorithm, which enables the ssh connection to succeed.
2) It modifies logic in reading and defaulting hardware config values, which was crashing.
3) It adds a new acceptance test with a preseed file to test loading from an http directory.
2020-07-23 09:40:57 +02:00
Adrien Delorme 125178d943
core: Decode: when in HCL2 decoding mode; reset the whole struct before preparing it. (#9622)
* core: Decode when in HCL2 decoding mode; reset the whole struct before preparing it.
* HCL2: add path variables + docs & tests

Co-authored-by: Megan Marsh <megan@hashicorp.com>
2020-07-23 09:25:07 +02:00
Adrien Delorme fd6be7f279 better/simpler `pause_before_connecting` example 2020-07-20 16:03:40 +02:00