Proxy and k8s/k8s_facts

18 views
Skip to first unread message

steven...@dxcas.com

unread,
Mar 28, 2019, 6:07:44 PM3/28/19
to Ansible Project
Hello

How can I use the k8s module over a proxy connection?

Using the `oc` command line tool seems to pick up my local env vars for `https_proxy` and just works.

---
- name: "Quota Applier"
  hosts: localhost
  connection: local
  become: false
  gather_facts: false
  environment:
    http_proxy: http://myproxy.com:8080
    https_proxy: http://myproxy.com:8080
    no_proxy: "localhost, 127.0.0.1"
  tasks:

    - name: Get a list of all project objects
    k8s_facts:
      kubeconfig: /home/me/.kube/config
      context: "default/console:8443/myuser"
      kind: projects
    register: project_list

Reply all
Reply to author
Forward
0 new messages