Browse Source
Manage containerd.io package with docker CRI. (#6218)
* Manage containerd.io package with docker CRI.
* Refactor common containerd stuff to separate role
* Fix check mode and unnecessary shell.
pull/6122/head
Lovro Seder
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with
90 additions and
50 deletions
-
roles/container-engine/containerd-common/defaults/main.yml
-
roles/container-engine/containerd-common/tasks/main.yml
-
roles/container-engine/containerd-common/vars/debian.yml
-
roles/container-engine/containerd-common/vars/fedora.yml
-
roles/container-engine/containerd-common/vars/redhat.yml
-
roles/container-engine/containerd-common/vars/ubuntu-amd64.yml
-
roles/container-engine/containerd-common/vars/ubuntu-arm64.yml
-
roles/container-engine/containerd/defaults/main.yml
-
roles/container-engine/containerd/meta/main.yml
-
roles/container-engine/containerd/tasks/crictl.yml
-
roles/container-engine/containerd/vars/debian.yml
-
roles/container-engine/containerd/vars/fedora.yml
-
roles/container-engine/containerd/vars/redhat.yml
-
roles/container-engine/containerd/vars/ubuntu-amd64.yml
-
roles/container-engine/docker/meta/main.yml
-
roles/container-engine/docker/tasks/main.yml
-
roles/container-engine/docker/tasks/systemd.yml
-
roles/container-engine/docker/vars/debian.yml
-
roles/container-engine/docker/vars/fedora.yml
-
roles/container-engine/docker/vars/redhat.yml
-
roles/container-engine/docker/vars/ubuntu-amd64.yml
-
roles/container-engine/docker/vars/ubuntu-arm64.yml
|
|
@ -0,0 +1,3 @@ |
|
|
|
--- |
|
|
|
containerd_version: '1.2.13' |
|
|
|
containerd_package: 'containerd.io' |
|
|
@ -0,0 +1,19 @@ |
|
|
|
--- |
|
|
|
- name: gather os specific variables |
|
|
|
include_vars: "{{ item }}" |
|
|
|
with_first_found: |
|
|
|
- files: |
|
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version|lower|replace('/', '_') }}.yml" |
|
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}-{{ host_architecture }}.yml" |
|
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}.yml" |
|
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version|lower|replace('/', '_') }}.yml" |
|
|
|
- "{{ ansible_distribution|lower }}-{{ host_architecture }}.yml" |
|
|
|
- "{{ ansible_distribution|lower }}.yml" |
|
|
|
- "{{ ansible_os_family|lower }}-{{ host_architecture }}.yml" |
|
|
|
- "{{ ansible_os_family|lower }}.yml" |
|
|
|
- defaults.yml |
|
|
|
paths: |
|
|
|
- ../vars |
|
|
|
skip: true |
|
|
|
tags: |
|
|
|
- facts |
|
|
@ -0,0 +1,11 @@ |
|
|
|
--- |
|
|
|
containerd_versioned_pkg: |
|
|
|
'latest': "{{ containerd_package }}" |
|
|
|
'1.2.4': "{{ containerd_package }}=1.2.4-1" |
|
|
|
'1.2.5': "{{ containerd_package }}=1.2.5-1" |
|
|
|
'1.2.6': "{{ containerd_package }}=1.2.6-3" |
|
|
|
'1.2.10': "{{ containerd_package }}=1.2.10-3" |
|
|
|
'1.2.12': "{{ containerd_package }}=1.2.12-1" |
|
|
|
'1.2.13': "{{ containerd_package }}=1.2.13-2" |
|
|
|
'stable': "{{ containerd_package }}=1.2.13-2" |
|
|
|
'edge': "{{ containerd_package }}=1.2.13-2" |
|
|
@ -0,0 +1,8 @@ |
|
|
|
--- |
|
|
|
containerd_versioned_pkg: |
|
|
|
'latest': "{{ containerd_package }}" |
|
|
|
'1.2.10': "{{ containerd_package }}-1.2.10-3.2.fc{{ ansible_distribution_major_version }}" |
|
|
|
'1.2.12': "{{ containerd_package }}-1.2.12-3.1.fc{{ ansible_distribution_major_version }}" |
|
|
|
'1.2.13': "{{ containerd_package }}-1.2.13-3.2.fc{{ ansible_distribution_major_version }}" |
|
|
|
'stable': "{{ containerd_package }}-1.2.13-3.2.fc{{ ansible_distribution_major_version }}" |
|
|
|
'edge': "{{ containerd_package }}-1.2.13-3.2.fc{{ ansible_distribution_major_version }}" |
|
|
@ -0,0 +1,11 @@ |
|
|
|
--- |
|
|
|
containerd_versioned_pkg: |
|
|
|
'latest': "{{ containerd_package }}" |
|
|
|
'1.2.4': "{{ containerd_package }}-1.2.4-3.1.el7" |
|
|
|
'1.2.5': "{{ containerd_package }}-1.2.5-3.1.el7" |
|
|
|
'1.2.6': "{{ containerd_package }}-1.2.6-3.3.el7" |
|
|
|
'1.2.10': "{{ containerd_package }}-1.2.10-3.2.el7" |
|
|
|
'1.2.12': "{{ containerd_package }}-1.2.12-3.1.el7" |
|
|
|
'1.2.13': "{{ containerd_package }}-1.2.13-3.2.el7" |
|
|
|
'stable': "{{ containerd_package }}-1.2.13-3.2.el7" |
|
|
|
'edge': "{{ containerd_package }}-1.2.13-3.2.el7" |
|
|
@ -0,0 +1,11 @@ |
|
|
|
--- |
|
|
|
containerd_versioned_pkg: |
|
|
|
'latest': "{{ containerd_package }}" |
|
|
|
'1.2.4': "{{ containerd_package }}=1.2.4-1" |
|
|
|
'1.2.5': "{{ containerd_package }}=1.2.5-1" |
|
|
|
'1.2.6': "{{ containerd_package }}=1.2.6-3" |
|
|
|
'1.2.10': "{{ containerd_package }}=1.2.10-3" |
|
|
|
'1.2.12': "{{ containerd_package }}=1.2.12-1" |
|
|
|
'1.2.13': "{{ containerd_package }}=1.2.13-2" |
|
|
|
'stable': "{{ containerd_package }}=1.2.13-2" |
|
|
|
'edge': "{{ containerd_package }}=1.2.13-2" |
|
|
@ -0,0 +1,8 @@ |
|
|
|
--- |
|
|
|
containerd_versioned_pkg: |
|
|
|
'latest': "{{ containerd_package }}" |
|
|
|
'1.2.10': "{{ containerd_package }}=1.2.10-3" |
|
|
|
'1.2.12': "{{ containerd_package }}=1.2.12-1" |
|
|
|
'1.2.13': "{{ containerd_package }}=1.2.13-2" |
|
|
|
'stable': "{{ containerd_package }}=1.2.13-2" |
|
|
|
'edge': "{{ containerd_package }}=1.2.13-2" |
|
|
@ -11,9 +11,6 @@ containerd_config: |
|
|
|
# containerd: |
|
|
|
# snapshotter: native |
|
|
|
|
|
|
|
containerd_version: '1.2.13' |
|
|
|
containerd_package: 'containerd.io' |
|
|
|
|
|
|
|
containerd_cfg_dir: /etc/containerd |
|
|
|
|
|
|
|
# Path to runc binary |
|
|
|
|
|
@ -0,0 +1,3 @@ |
|
|
|
--- |
|
|
|
dependencies: |
|
|
|
- role: container-engine/containerd-common |
|
|
@ -22,12 +22,13 @@ |
|
|
|
delegate_to: "{{ inventory_hostname }}" |
|
|
|
|
|
|
|
- name: Get crictl completion |
|
|
|
shell: "{{ bin_dir }}/crictl completion" |
|
|
|
command: "{{ bin_dir }}/crictl completion" |
|
|
|
changed_when: False |
|
|
|
register: cri_completion |
|
|
|
check_mode: False |
|
|
|
|
|
|
|
- name: Install crictl completion |
|
|
|
copy: |
|
|
|
dest: /etc/bash_completion.d/crictl |
|
|
|
content: "{{ cri_completion.stdout }}" |
|
|
|
become: True |
|
|
|
become: True |
|
|
@ -1,16 +1,4 @@ |
|
|
|
--- |
|
|
|
|
|
|
|
containerd_versioned_pkg: |
|
|
|
'latest': "{{ containerd_package }}" |
|
|
|
'1.2.4': "{{ containerd_package }}=1.2.4-1" |
|
|
|
'1.2.5': "{{ containerd_package }}=1.2.5-1" |
|
|
|
'1.2.6': "{{ containerd_package }}=1.2.6-3" |
|
|
|
'1.2.10': "{{ containerd_package }}=1.2.10-3" |
|
|
|
'1.2.12': "{{ containerd_package }}=1.2.12-1" |
|
|
|
'1.2.13': "{{ containerd_package }}=1.2.13-2" |
|
|
|
'stable': "{{ containerd_package }}=1.2.13-2" |
|
|
|
'edge': "{{ containerd_package }}=1.2.13-2" |
|
|
|
|
|
|
|
containerd_package_info: |
|
|
|
pkg_mgr: apt |
|
|
|
pkgs: |
|
|
|
|
|
@ -1,13 +1,4 @@ |
|
|
|
--- |
|
|
|
|
|
|
|
containerd_versioned_pkg: |
|
|
|
'latest': "{{ containerd_package }}" |
|
|
|
'1.2.10': "{{ containerd_package }}-1.2.10-3.2.fc{{ ansible_distribution_major_version }}" |
|
|
|
'1.2.12': "{{ containerd_package }}-1.2.12-3.2.fc{{ ansible_distribution_major_version }}" |
|
|
|
'1.2.13': "{{ containerd_package }}-1.2.13-3.2.fc{{ ansible_distribution_major_version }}" |
|
|
|
'stable': "{{ containerd_package }}-1.2.13-3.2.fc{{ ansible_distribution_major_version }}" |
|
|
|
'edge': "{{ containerd_package }}-1.2.13-3.2.fc{{ ansible_distribution_major_version }}" |
|
|
|
|
|
|
|
containerd_package_info: |
|
|
|
pkg_mgr: dnf |
|
|
|
pkgs: |
|
|
|
|
|
@ -1,16 +1,4 @@ |
|
|
|
--- |
|
|
|
|
|
|
|
containerd_versioned_pkg: |
|
|
|
'latest': "{{ containerd_package }}" |
|
|
|
'1.2.4': "{{ containerd_package }}-1.2.4-3.1.el7" |
|
|
|
'1.2.5': "{{ containerd_package }}-1.2.5-3.1.el7" |
|
|
|
'1.2.6': "{{ containerd_package }}-1.2.6-3.3.el7" |
|
|
|
'1.2.10': "{{ containerd_package }}-1.2.10-3.2.el7" |
|
|
|
'1.2.12': "{{ containerd_package }}-1.2.12-3.1.el7" |
|
|
|
'1.2.13': "{{ containerd_package }}-1.2.13-3.2.el7" |
|
|
|
'stable': "{{ containerd_package }}-1.2.13-3.2.el7" |
|
|
|
'edge': "{{ containerd_package }}-1.2.13-3.2.el7" |
|
|
|
|
|
|
|
containerd_package_info: |
|
|
|
pkg_mgr: yum |
|
|
|
pkgs: |
|
|
|
|
|
@ -1,16 +1,4 @@ |
|
|
|
--- |
|
|
|
|
|
|
|
containerd_versioned_pkg: |
|
|
|
'latest': "{{ containerd_package }}" |
|
|
|
'1.2.4': "{{ containerd_package }}=1.2.4-1" |
|
|
|
'1.2.5': "{{ containerd_package }}=1.2.5-1" |
|
|
|
'1.2.6': "{{ containerd_package }}=1.2.6-3" |
|
|
|
'1.2.10': "{{ containerd_package }}=1.2.10-3" |
|
|
|
'1.2.12': "{{ containerd_package }}=1.2.12-1" |
|
|
|
'1.2.13': "{{ containerd_package }}=1.2.13-2" |
|
|
|
'stable': "{{ containerd_package }}=1.2.13-2" |
|
|
|
'edge': "{{ containerd_package }}=1.2.13-2" |
|
|
|
|
|
|
|
containerd_package_info: |
|
|
|
pkg_mgr: apt |
|
|
|
pkgs: |
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
--- |
|
|
|
dependencies: |
|
|
|
- role: container-engine/containerd-common |
|
|
|
- role: container-engine/docker-storage |
|
|
|
when: docker_container_storage_setup and ansible_os_family == "RedHat" |
|
|
@ -196,6 +196,7 @@ |
|
|
|
- docker_task_result is failed |
|
|
|
- ansible_distribution == 'Ubuntu' |
|
|
|
register: available_packages |
|
|
|
check_mode: false |
|
|
|
|
|
|
|
- name: show available packages on ubuntu |
|
|
|
fail: |
|
|
@ -239,6 +240,7 @@ |
|
|
|
command: "docker version -f '{{ '{{' }}.Client.Version{{ '}}' }}'" |
|
|
|
register: installed_docker_version |
|
|
|
changed_when: false |
|
|
|
check_mode: false |
|
|
|
|
|
|
|
- name: check minimum docker version for docker_dns mode. You need at least docker version >= 1.12 for resolvconf_mode=docker_dns |
|
|
|
fail: |
|
|
|
|
|
@ -17,6 +17,7 @@ |
|
|
|
register: systemd_version |
|
|
|
when: not is_ostree |
|
|
|
changed_when: false |
|
|
|
check_mode: false |
|
|
|
|
|
|
|
- name: Write docker.service systemd file |
|
|
|
template: |
|
|
|
|
|
@ -24,6 +24,8 @@ docker_cli_versioned_pkg: |
|
|
|
docker_package_info: |
|
|
|
pkg_mgr: apt |
|
|
|
pkgs: |
|
|
|
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}" |
|
|
|
force: yes |
|
|
|
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}" |
|
|
|
force: yes |
|
|
|
- name: "{{ docker_versioned_pkg[docker_version | string] }}" |
|
|
|
|
|
@ -21,5 +21,6 @@ docker_cli_versioned_pkg: |
|
|
|
docker_package_info: |
|
|
|
pkg_mgr: dnf |
|
|
|
pkgs: |
|
|
|
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}" |
|
|
|
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}" |
|
|
|
- name: "{{ docker_versioned_pkg[docker_version | string] }}" |
|
|
@ -35,6 +35,8 @@ docker_pkgs_use_docker_ce: |
|
|
|
yum_conf: "{{ docker_yum_conf }}" |
|
|
|
|
|
|
|
docker_pkgs: |
|
|
|
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}" |
|
|
|
yum_conf: "{{ docker_yum_conf }}" |
|
|
|
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}" |
|
|
|
yum_conf: "{{ docker_yum_conf }}" |
|
|
|
- name: "{{ docker_versioned_pkg[docker_version | string] }}" |
|
|
|
|
|
@ -24,6 +24,8 @@ docker_cli_versioned_pkg: |
|
|
|
docker_package_info: |
|
|
|
pkg_mgr: apt |
|
|
|
pkgs: |
|
|
|
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}" |
|
|
|
force: yes |
|
|
|
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}" |
|
|
|
force: yes |
|
|
|
- name: "{{ docker_versioned_pkg[docker_version | string] }}" |
|
|
|
|
|
@ -20,6 +20,8 @@ docker_cli_versioned_pkg: |
|
|
|
docker_package_info: |
|
|
|
pkg_mgr: apt |
|
|
|
pkgs: |
|
|
|
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}" |
|
|
|
force: yes |
|
|
|
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}" |
|
|
|
force: yes |
|
|
|
- name: "{{ docker_versioned_pkg[docker_version | string] }}" |
|
|
|