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 converge behind http proxy #241

Open
dgengtek opened this issue Jun 13, 2018 · 3 comments
Open

kitchen converge behind http proxy #241

dgengtek opened this issue Jun 13, 2018 · 3 comments
Milestone

Comments

@dgengtek
Copy link

dgengtek commented Jun 13, 2018

Question

How do I set http_proxy for the provisioner? During $ kitchen converge I get timeouts since the docker image is unable to pull the repositories.


driver:
  name: docker
  hostname: some_service.ci.local
  #socket: tcp://127.0.0.1:2376
  use_sudo: false
  http_proxy: <%= ENV['http_proxy'] || "http://proxy:3128" %>
  https_proxy: <%= ENV['https_proxy'] || "http://proxy:3128" %>

provisioner:
  name: salt_solo
  salt_install: bootstrap
  salt_version: latest
  http_proxy: <%= ENV['http_proxy'] || "http://proxy:3128" %>
  https_proxy: <%= ENV['https_proxy'] || "http://proxy:3128" %>
  require_chef: false
  formula: some_service
  log_level: info
  state_top:
    base:
      "*":
        - some_service
  pillars:
    top.sls:
      base:
        "*":
          - some_service
  grains:
    noservices: True
  pillars_from_files:
    some_service.sls: tests/pillar/default.sls


platforms:
  - name: centos7
    driver_config:
      image: dgengtek/centos7:v1
      platform: centos


verifier:
  name: shell
  remote_exec: false
  command: pytest -v tests/integration/

suites:
  - name: default
@gtmanfred
Copy link
Contributor

That sounds like a problem for kitchen-docker, not kitchen-salt, since it can't pull the image for the driver config.

https://github.com/test-kitchen/kitchen-docker/

Is there something you need the http_proxy for the actually provisioner? and not the driver.

@dgengtek
Copy link
Author

dgengtek commented Jun 13, 2018

But it fails to pull the bootstrap script for the install during converge(curl is unable to pick up the proxy settings) which is the responsibility of the provisioner? I also tested with an image which sets proxy settings in /etc/environment but still fails to pull the bootstrap script with curl during converge. $ kitchen create works since kitchen docker creates a dockerfile with the required http_proxy and https_proxy env variables and is able to install via yum.

Also to mention

provisioner:
  salt_install: yum
  salt_version: latest

fails with
https://repo.saltstack.com/yum/redhat/7/x86_64/archive/latest/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

while using the version works

provisioner:
  salt_install: yum
  salt_version: 2018.3.0

@gtmanfred
Copy link
Contributor

Hrm, that is a different bug, because latest should just use the .rpm file for installing the repository.

https://kitchen.saltstack.com/docs/file/docs/provisioner_options.md#salt_yum_repo

Changing salt_yum_repo to https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest

Will fix this as a work around.

As for downloading the bootstrap file, with the latest version of kitchen-salt, you can specify a local file as a bootstrap script, so I would just download the bootstrap script and reference ./bootstrap.sh for now.

I will mark this as a Feature Request.

@gtmanfred gtmanfred added this to the Approved milestone Jun 13, 2018
@dgengtek dgengtek reopened this Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants