Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kitchen and Busser are ignoring the http_proxy parameter (and it doesn't have a gem source option) #37

Closed
dfduarte opened this issue Jul 20, 2016 · 5 comments

Comments

@dfduarte
Copy link

dfduarte commented Jul 20, 2016

Hello there,

Recently, I started to use Kitchen to make some tests on our cookbooks here. As part of our framework, these cookbooks must be tested on our AWS environment, to assure their reliability and working.

Given that, I made the following kitchen yml file:


---
driver:
  driver_config:
  name: ec2
  aws_ssh_key_id: xxxxxxxxxxxxKey
  shared_credentials_profile: default
  require_chef_omnibus: true
  region: us-east-1
  iam_profile_name: xxxxxxxxxxIAM
  instance_type: t2.large
  associate_public_ip: false
  interface: private


transport:
  ssh_key: '/Users/xxxxx/workspace/Keys/xxxxxx.pem'
  connection_timeout: 10
  connection_retries: 5
  ssh_timeout: 5
  username: centos


provisioner:
  name: chef_zero
  http_proxy: 'http://xxxxxx:3128'
  https_proxy: 'http://xxxx:3128'
  require_chef_omnibus: '12.12.15'
  nodes_path: 'test/nodes'

platforms:
  - name: centos-7.1
    driver:
      image_id: ami-xxxxxxxx
      subnet_id:  subnet-4xxxxxx
      security_group_ids: ["sg-xxxxxxx"]

suites:
  - name: default
    http_proxy: 'http://xxxx:3128'
    https_proxy: 'http://xxxx:3128'
    run_list:
      - recipe[squid-aws::default]
    attributes:
      ddnsupdate:
        no_ddnssec: true
        use_resolv_conf: true
        ttl: 300
      yum:
        main:
          proxy: 'http://xxxxx:3128'

Everything works and has been converged, and we need proxy for every installation at this machine, because our instances there aren't exposed to the internet directly.

But, when we hit the Busser installation stage, we got this:

-----> Verifying <default-centos-71>...
       Preparing files for transfer
D      Creating local sandbox in /var/folders/tl/lcf69pls00q84xm27bxc9b75_fdjrs/T/default-centos-71-sandbox-20160720-72793-1x6udaz
D      [SSH] reusing existing connection centos@10.157.57.233<{:user_known_hosts_file=>"/dev/null", :paranoid=>false, :port=>22, :compression=>false, :compression_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>10, :keys_only=>true, :keys=>["/Users/dduarte/workspace/Keys/3cSharedLab.pem"], :auth_methods=>["publickey"], :user=>"centos"}>
D      [SSH] centos@10.157.57.233<{:user_known_hosts_file=>"/dev/null", :paranoid=>false, :port=>22, :compression=>false, :compression_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>10, :keys_only=>true, :keys=>["/Users/dduarte/workspace/Keys/3cSharedLab.pem"], :auth_methods=>["publickey"], :user=>"centos"}> (sh -c '
BUSSER_ROOT="/tmp/verifier"; export BUSSER_ROOT
GEM_HOME="/tmp/verifier/gems"; export GEM_HOME
GEM_PATH="/tmp/verifier/gems"; export GEM_PATH
GEM_CACHE="/tmp/verifier/gems/cache"; export GEM_CACHE
ruby="/opt/chef/embedded/bin/ruby"
gem="/opt/chef/embedded/bin/gem"
version="busser"
gem_install_args="busser --no-rdoc --no-ri --no-format-executable -n /tmp/verifier/bin --no-user-install"
busser="sudo -E /tmp/verifier/bin/busser"
plugins="busser-serverspec"

$gem list busser -i 2>&1 >/dev/null
if test $? -ne 0; then
  echo "-----> Installing Busser ($version)"
  $gem install $gem_install_args
else
  echo "-----> Busser installation detected ($version)"
fi

if test ! -f "$BUSSER_ROOT/bin/busser"; then
  $busser setup
fi

echo "       Installing Busser plugins: $plugins"
$busser plugin install $plugins
')
-----> Installing Busser (busser)
^CD      Cleaning up local sandbox in /var/folders/tl/lcf69pls00q84xm27bxc9b75_fdjrs/T/default-centos-71-sandbox-20160720-72793-1x6udaz
D      [SSH] shutting previous connection centos@xxxxxxxxxxxxx<{:user_known_hosts_file=>"/dev/null", :paranoid=>false, :port=>22, :compression=>false, :compression_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>10, :keys_only=>true, :keys=>["/Users/xxxx/workspace/Keys/xxxxxxxx.pem"], :auth_methods=>["publickey"], :user=>"centos"}>
D      [SSH] closing connection to centos@1xxxxxxxx<{:user_known_hosts_file=>"/dev/null", :paranoid=>false, :port=>22, :compression=>false, :compression_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>10, :keys_only=>true, :keys=>["/Users/dxxxxxxx/workspace/Keys/xxxxxxxx.pem"], :auth_methods=>["publickey"], :user=>"centos"}>

And the installs hangs for good on "installing busser"

I tried a lot of http_proxy combinations on kitchen yml file, but they haven't worked, and Busser's installation behaves as the same way, not using the proxy.

Any suggestions?

@dfduarte
Copy link
Author

Oh additionally: I know Busser is a RubyGem. Would be good, if the mentioned above is not fixable, at least there is a way to pass a remote ruby gem repository.

We use a local Artifactory server as well, and have a way to use it to get the gems, at least, would be good (os is there a way to do that?)

@dfduarte dfduarte changed the title Kitchen and Busser are ignoring the http_proxy parameter Kitchen and Busser are ignoring the http_proxy parameter (and it doesn't have a gem source option) Jul 20, 2016
@backtorod
Copy link

Hi dfduarte,

Any look with your issue? We are having the same issue with ChefDK 0.10.0

Cheers,
Rod

@dfduarte
Copy link
Author

dfduarte commented Oct 7, 2016

@rguareschi A Chef engineer from my company gave me an alternative solution, that is creating a fixture putting a new file in /etc/profile.d with the proxy, or even inside the cookbook.

As the http_proxy it's a requirement for my demand here, I put it directly as a cookbook_file during the provisioning. It worked, since Busser opens a new Kitchen SSH session after provisioning the cookbook. For some reason, it worked for me.

But of course, a http_proxy param for busser would be a neater solution

@backtorod
Copy link

backtorod commented Oct 7, 2016

Hi @dfduarte thanks for the follow up. I got it working and my kitchen test is working perfectly now setting 3 lines in the kitchen.yml file as per our friend xsmaster #33

I've added this in the driver declaration:

http_proxy: http://<your_proxy:port>
https_proxy: http://<your_proxy:port>
no_proxy: "<anything_to_bypass>

Have you tried this?

Cheers,
Rod

@damacus
Copy link

damacus commented Apr 4, 2022

Closing due to inactivity.

If this is still an issue please reopen or open another issue.

Thanks,
Test-Kitchen Maintainers

@damacus damacus closed this as completed Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants