-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Proxy small fixes #7102
Proxy small fixes #7102
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,26 +10,16 @@ | |
tags: | ||
- facts | ||
|
||
- name: Check if a proxy is set in /etc/dnf/dnf.conf | ||
raw: grep -qs 'proxy=' /etc/dnf/dnf.conf | ||
register: need_http_proxy | ||
failed_when: false | ||
changed_when: false | ||
# This command should always run, even in check mode | ||
check_mode: false | ||
environment: {} | ||
when: | ||
- http_proxy is defined | ||
- not skip_http_proxy_on_os_packages | ||
|
||
- name: Add http_proxy to /etc/dnf/dnf.conf if http_proxy is defined | ||
raw: echo 'proxy={{ http_proxy }}' >> /etc/dnf/dnf.conf | ||
- name: Add proxy to dnf.conf if http_proxy is defined | ||
ini_file: | ||
path: "/etc/dnf/dnf.conf" | ||
section: main | ||
option: proxy | ||
value: "{{ http_proxy | default(omit) }}" | ||
state: "{{ http_proxy | default(False) | ternary('present', 'absent') }}" | ||
no_extra_spaces: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consistent configuration way as the same as centos one. |
||
become: true | ||
environment: {} | ||
when: | ||
- http_proxy is defined | ||
- need_http_proxy.rc != 0 | ||
- not skip_http_proxy_on_os_packages | ||
when: not skip_http_proxy_on_os_packages | ||
|
||
- name: Install python3 on fedora | ||
raw: "dnf install --assumeyes --quiet python3" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
{{ apiserver_loadbalancer_domain_name| default('') }}, | ||
{{ loadbalancer_apiserver.address | default('') }}, | ||
{%- endif -%} | ||
{%- if ( (no_proxy_exclude_workers is defined) and (no_proxy_exclude_workers) ) -%} | ||
{%- if no_proxy_exclude_workers | default(false) -%} | ||
{% set cluster_or_master = 'kube-master' %} | ||
{% else %} | ||
{%- else -%} | ||
{% set cluster_or_master = 'k8s-cluster' %} | ||
{% endif %} | ||
{%- endif -%} | ||
{%- for item in (groups[cluster_or_master] + groups['etcd']|default([]) + groups['calico-rr']|default([]))|unique -%} | ||
{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(fallback_ips[item])) }}, | ||
{%- if item != hostvars[item].get('ansible_hostname', '') -%} | ||
|
@@ -22,7 +22,7 @@ | |
{%- if additional_no_proxy is defined -%} | ||
{{ additional_no_proxy }}, | ||
{%- endif -%} | ||
127.0.0.1,localhost,{{ kube_service_addresses }},{{ kube_pods_subnet }} | ||
127.0.0.1,localhost,{{ kube_service_addresses }},{{ kube_pods_subnet }},svc,svc.{{ dns_domain }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: this additional svc non_proxy configuration is for avoiding http proxy on k8s internal communication. |
||
delegate_to: localhost | ||
connection: local | ||
delegate_facts: yes | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for me: dnf is newer package management system than yum and it is available on centos8.