mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-25 23:16:05 -03:30
Add proxy support to CRI-O service (#4607)
* Add proxy support to CRI-O service The crio.service requires proxy environment variables when it's deployed behind a corporated network. This change creates a systemd configuration file when the proxy variables are defined. * Remove unnecesary crio's tasks
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
with_items:
|
||||
- /etc/crio
|
||||
- /etc/containers
|
||||
- /etc/systemd/system/crio.service.d
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
@@ -64,6 +65,7 @@
|
||||
state: present
|
||||
when: not is_ostree
|
||||
with_items: "{{ crio_packages }}"
|
||||
notify: restart crio
|
||||
|
||||
- name: Check if already installed
|
||||
stat:
|
||||
@@ -110,6 +112,7 @@
|
||||
dest: /etc/containers/mounts.conf
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
notify: restart crio
|
||||
|
||||
- name: Create directory for oci hooks
|
||||
file:
|
||||
@@ -118,12 +121,9 @@
|
||||
owner: root
|
||||
mode: 0755
|
||||
|
||||
- name: Reload systemd daemon
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
|
||||
- name: Install cri-o service
|
||||
service:
|
||||
name: "{{ crio_service }}"
|
||||
enabled: yes
|
||||
state: restarted
|
||||
- name: Write cri-o proxy drop-in
|
||||
template:
|
||||
src: http-proxy.conf.j2
|
||||
dest: /etc/systemd/system/crio.service.d/http-proxy.conf
|
||||
notify: restart crio
|
||||
when: http_proxy is defined or https_proxy is defined
|
||||
|
||||
Reference in New Issue
Block a user