packer-plugin-goss icon indicating copy to clipboard operation
packer-plugin-goss copied to clipboard

Passing ENV variable to goss plugin

Open tuxtof opened this issue 1 year ago • 4 comments

is there a way to set env variable in the context where the goss binary is downloaded ? I want to set proxy env variable to let curl || wget to connect on internet

tuxtof avatar Jan 26 '24 14:01 tuxtof

is there a way to set env variable in the context where the goss binary is downloaded ? I want to set proxy env variable to let curl || wget to connect on internet

Are you talking about creating an environment variable for the base part of url in the getDownloadUrl method here: https://github.com/YaleUniversity/packer-plugin-goss/blob/ac683306d9b7699f3f476c7e067bb576d3917721/provisioner/goss/packer-provisioner-goss.go#L465?

btassone avatar Feb 07 '24 03:02 btassone

no i'm talking about specifying env variable used by the wget/curl command who download the goss binary to change their behaviour, in this specific case use a proxy

tuxtof avatar Feb 07 '24 07:02 tuxtof

I think the plugin does provide that ability using VarsEnv var:

https://github.com/YaleUniversity/packer-plugin-goss/blob/ac683306d9b7699f3f476c7e067bb576d3917721/provisioner/goss/packer-provisioner-goss.go#L472-L490

In case I find some time I could try to provide you an example ..

FalcoSuessgott avatar Feb 07 '24 12:02 FalcoSuessgott

Hello,

I have the same question and problem:

  • my remote instance running goss and the installGoss function, is behind a corporate proxy and can't "curl||wget" directly the goss package from github.

Do you know, if there is a way to override/set http_proxy,https_proxy,no_proxy variable in installGoss part, around this function Packer.RemoteCmdrunning curl/wget ?

https://github.com/YaleUniversity/packer-plugin-goss/blob/master/provisioner/goss/packer-provisioner-goss.go#L333

envVar function does not work at this step.

Thank you for you help

pli01 avatar May 05 '24 06:05 pli01