1

I'm currently trying to use Kubespray in the download_localhost: true mode. I also have download_run_once set to true. Some info, I'm running this behind a proxy on our network, nothing else is allowed out of our network at 443. Everything runs fine, images download, until I get to the download_file step. It looks like no matter what I do, download_file does not pick up on proxy settings. I've set it via the -e option on the ansible-playbook command, I've set it in the group_vars file, and I've also ensured that use_proxy is on for the download_file task. I've confirmed that I can wget the file on the local host, so I know it's not blocked on our network. I'm just trying to figure out if this is a bug at this point. Thanks!

Edit: examples of the only modification I've made to files to help reproduce:

./inventory/mycluster/group_vars/all/all.yml

deploy_container_engine:false

proxy_env:
    https_proxy: "http://192.186.1.2:8080"
    http_proxy: "http://192.186.1.2:8080"
    no_proxy: "mydomain"

./extra_playbooks/roles/download/defaults/main.yml

download_run_once: true
download_localhost: true

/etc/environment

https_proxy: "http://192.168.1.2:8080"
http_proxy: "http://192.168.1.2:8080"
no_proxy: "mydomain"

./cluster.yml

- hosts: all
  environment: 
    http_proxy: http://192.168.1.2:8080"
    https_proxy: http://192.168.1.2:8080"

I've also experimented with added the following setting to the download_file | Download Item task:

 - name: download_file | Download item
   use_proxy: yes
ngpriddy
  • 66
  • 10
  • Please consider an [MCVE](https://stackoverflow.com/help/mcve) and be aware that, AFAIK, the `-e` (and its `group_vars` friend) are not how one provides proxy settings to ansible, that happens via [`environment:`](https://docs.ansible.com/ansible/2.10/user_guide/playbooks_environment.html) either on the playbook or on the task itself – mdaniel Jan 17 '21 at 02:02
  • Thank you! Yeah, I tried adding the -e as a last resort just to see if it worked. I have my proxy added via the proxy_env: method in my ./kubespray/inventory/mygluster/group_vars/all/all.yml file and via the environment: method in the cluster.yml file. – ngpriddy Jan 20 '21 at 20:08

1 Answers1

3

It looks like kubespray only successfully uses the proxy for all tasks when utilizing the proxy variables built into ./inventory/mycluster/group_vars/all/all.yml.

ngpriddy
  • 66
  • 10