mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-19 04:00:11 -03:30
Refactor containerd ubuntu setup and remove redundant tasks (#5015)
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
4132cee687
commit
d22634a597
@@ -36,27 +36,6 @@
|
||||
- ansible_os_family in ['Ubuntu', 'Debian']
|
||||
- not is_atomic
|
||||
|
||||
- name: ensure containerd repository public key is installed
|
||||
action: "{{ containerd_repo_key_info.pkg_key }}"
|
||||
args:
|
||||
id: "{{ item }}"
|
||||
url: "{{ containerd_repo_key_info.url }}"
|
||||
state: present
|
||||
register: keyserver_task_result
|
||||
until: keyserver_task_result is succeeded
|
||||
retries: 4
|
||||
delay: "{{ retry_stagger | d(3) }}"
|
||||
with_items: "{{ containerd_repo_key_info.repo_keys }}"
|
||||
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS", "RedHat", "Suse", "ClearLinux"] or is_atomic)
|
||||
|
||||
- name: ensure containerd repository is enabled
|
||||
action: "{{ containerd_repo_info.pkg_repo }}"
|
||||
args:
|
||||
repo: "{{ item }}"
|
||||
state: present
|
||||
with_items: "{{ containerd_repo_info.repos }}"
|
||||
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS", "RedHat", "Suse", "ClearLinux"] or is_atomic) and (containerd_repo_info.repos|length > 0)
|
||||
|
||||
- name: Configure containerd repository on Fedora
|
||||
template:
|
||||
src: "fedora_containerd.repo.j2"
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
delegate_to: "{{ inventory_hostname }}"
|
||||
|
||||
- name: Install crictl completion
|
||||
shell: /usr/local/bin/crictl completion >/etc/bash_completion.d/crictl
|
||||
shell: "{{ bin_dir }}/crictl completion >/etc/bash_completion.d/crictl"
|
||||
ignore_errors: True
|
||||
when: ansible_distribution in ["CentOS","RedHat", "Ubuntu", "Debian"]
|
||||
|
||||
@@ -42,33 +42,6 @@
|
||||
mode: 0644
|
||||
notify: restart containerd
|
||||
|
||||
|
||||
- name: ensure containerd repository public key is installed
|
||||
action: "{{ containerd_repo_key_info.pkg_key }}"
|
||||
args:
|
||||
id: "{{ item }}"
|
||||
url: "{{ containerd_repo_key_info.url }}"
|
||||
state: present
|
||||
register: keyserver_task_result
|
||||
until: keyserver_task_result is succeeded
|
||||
retries: 4
|
||||
delay: "{{ retry_stagger | d(3) }}"
|
||||
with_items: "{{ containerd_repo_key_info.repo_keys }}"
|
||||
when:
|
||||
- ansible_os_family in ['Ubuntu', 'Debian']
|
||||
- not is_atomic
|
||||
|
||||
- name: ensure containerd repository is enabled
|
||||
action: "{{ containerd_repo_info.pkg_repo }}"
|
||||
args:
|
||||
repo: "{{ item }}"
|
||||
state: present
|
||||
with_items: "{{ containerd_repo_info.repos }}"
|
||||
when:
|
||||
- ansible_os_family in ['Ubuntu', 'Debian']
|
||||
- not is_atomic
|
||||
- containerd_repo_info.repos|length > 0
|
||||
|
||||
# This is required to ensure any apt upgrade will not break kubernetes
|
||||
- name: Set containerd pin priority to apt_preferences on Debian family
|
||||
template:
|
||||
@@ -119,14 +92,4 @@
|
||||
- not is_atomic
|
||||
- not runc_stat.stat.exists
|
||||
|
||||
- name: Install crictl config
|
||||
template:
|
||||
src: crictl.yaml.j2
|
||||
dest: /etc/crictl.yaml
|
||||
owner: bin
|
||||
mode: 0644
|
||||
|
||||
- name: Install crictl completion
|
||||
shell: "{{ bin_dir }}/crictl completion >/etc/bash_completion.d/crictl"
|
||||
ignore_errors: True
|
||||
when: ansible_distribution in ["CentOS","RedHat", "Ubuntu", "Debian"]
|
||||
- include_tasks: crictl.yml
|
||||
|
||||
Reference in New Issue
Block a user