Added the HTTPS proxy option

This commit is contained in:
Jeroen de Korte 2015-07-03 16:27:52 +02:00
parent 007ab6e503
commit 1c14bfd04d
2 changed files with 21 additions and 0 deletions

View File

@ -22,6 +22,9 @@ func (p *Provisioner) linuxInstallChefClient(
if p.HTTPProxy != "" {
prefix += fmt.Sprintf("http_proxy='%s' ", p.HTTPProxy)
}
if p.HTTPSProxy != "" {
prefix += fmt.Sprintf("https_proxy='%s' ", p.HTTPSProxy)
}
if p.NOProxy != nil {
prefix += fmt.Sprintf("no_proxy='%s' ", strings.Join(p.NOProxy, ","))
}

View File

@ -64,6 +64,24 @@ func TestResourceProvider_linuxInstallChefClient(t *testing.T) {
},
},
"HTTPSProxy": {
Config: testConfig(t, map[string]interface{}{
"https_proxy": "https://proxy.local",
"node_name": "nodename1",
"prevent_sudo": true,
"run_list": []interface{}{"cookbook::recipe"},
"server_url": "https://chef.local",
"validation_client_name": "validator",
"validation_key_path": "validator.pem",
}),
Commands: map[string]bool{
"https_proxy='https://proxy.local' curl -LO https://www.chef.io/chef/install.sh": true,
"https_proxy='https://proxy.local' bash ./install.sh -v \"\"": true,
"https_proxy='https://proxy.local' rm -f install.sh": true,
},
},
"NOProxy": {
Config: testConfig(t, map[string]interface{}{
"http_proxy": "http://proxy.local",