YaleUniversity / packer-plugin-goss

Goss Provisioner for Packer
MIT License
139 stars 45 forks source link

Passing ENV variable to goss plugin #82

Open tuxtof opened 8 months ago

tuxtof commented 8 months ago

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

btassone commented 8 months ago

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?

tuxtof commented 7 months ago

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

FalcoSuessgott commented 7 months ago

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 ..

pli01 commented 5 months ago

Hello,

I have the same question and problem:

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