ljfranklin / terraform-resource

A concourse resource to create infrastructure via Terraform
MIT License
185 stars 85 forks source link

SSH warnings during module download #179

Open david-frost-ons opened 2 years ago

david-frost-ons commented 2 years ago

Hi, great work on the terraform resource! generally its worked great. Im having one issue that i thought it worth bringing to you.

Im using the private_key parameter to access some organisation internal repos. This generally works but im getting some ssh erros reported which im concerned that my config isnt quite right.

Note that we are using a GitHub oauth for cloning repositories using git, this is a problem of terraform downloading modules.

The ssh errors reported are:

2022/08/03 12:54:01 agent 27: ssh: parse error in message type 27 2022/08/03 12:54:04 agent 27: ssh: parse error in message type 27 2022/08/03 12:54:05 agent 27: ssh: parse error in message type 27

I thought this might mean that i have some trailing garbage on the private_key after putting it into a yaml vars file but ive been unable to locate the private key on the nodes running the terraform so ive been unable to compare what it should be with whats being used.

ljfranklin commented 2 years ago

We don't write the private key to disk, we add it directly to the SSH agent here. YAML has a couple different ways of specifying multiline strings, maybe try messing with those: https://yaml-multiline.info/. Or you can add some logging to stderr in the resource and build a custom resource as described here.