packer-plugin-goss
packer-plugin-goss copied to clipboard
Passing ENV variable to goss plugin
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
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?
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
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 ..
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.RemoteCmd
running 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