proxy.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. - name: Check for cluster http proxy
  3. command: >
  4. oc get proxies.config.openshift.io cluster
  5. --kubeconfig={{ openshift_node_kubeconfig_path }}
  6. --output=jsonpath='{.status.httpProxy}'
  7. register: oc_get_http_proxy
  8. delegate_to: localhost
  9. - name: Set http proxy
  10. set_fact:
  11. http_proxy: "{{ oc_get_http_proxy.stdout }}"
  12. when: oc_get_http_proxy.stdout | length > 0
  13. - name: Check for cluster https proxy
  14. command: >
  15. oc get proxies.config.openshift.io cluster
  16. --kubeconfig={{ openshift_node_kubeconfig_path }}
  17. --output=jsonpath='{.status.httpsProxy}'
  18. register: oc_get_https_proxy
  19. delegate_to: localhost
  20. - name: Set https proxy
  21. set_fact:
  22. https_proxy: "{{ oc_get_https_proxy.stdout }}"
  23. when: oc_get_https_proxy.stdout | length > 0
  24. - name: Check for cluster no proxy
  25. command: >
  26. oc get proxies.config.openshift.io cluster
  27. --kubeconfig={{ openshift_node_kubeconfig_path }}
  28. --output=jsonpath='{.status.noProxy}'
  29. register: oc_get_no_proxy
  30. delegate_to: localhost
  31. - name: Set no proxy
  32. set_fact:
  33. no_proxy: "{{ oc_get_no_proxy.stdout }}"
  34. when: oc_get_no_proxy.stdout | length > 0
  35. - name: Check for additional trust bundle
  36. command: >
  37. oc get configmap user-ca-bundle -n openshift-config
  38. --kubeconfig={{ openshift_node_kubeconfig_path }}
  39. --output=jsonpath='{.data.ca-bundle\.crt}'
  40. register: oc_get_additional_trust_bundle
  41. delegate_to: localhost
  42. failed_when: false
  43. - when: oc_get_additional_trust_bundle.stdout | length > 0
  44. block:
  45. - name: Set additional trust bundle
  46. set_fact:
  47. l_additional_trust_bundle: "{{ oc_get_additional_trust_bundle.stdout }}"
  48. - name: Copy additional trust bundle to system CA trust
  49. copy:
  50. content: "{{ l_additional_trust_bundle }}"
  51. dest: "/etc/pki/ca-trust/source/anchors/ca-bundle.crt"
  52. - name: Update CA trust
  53. command: update-ca-trust extract