kitchen-salt icon indicating copy to clipboard operation
kitchen-salt copied to clipboard

kitchen converge behind http proxy

Open dgengtek opened this issue 6 years ago • 3 comments

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

dgengtek avatar Jun 13 '18 20:06 dgengtek

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.

gtmanfred avatar Jun 13 '18 20:06 gtmanfred

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

dgengtek avatar Jun 13 '18 20:06 dgengtek

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 avatar Jun 13 '18 20:06 gtmanfred