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
parent
commit
5dd85197af
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 90 additions and 50 deletions
  1. 3
      roles/container-engine/containerd-common/defaults/main.yml
  2. 19
      roles/container-engine/containerd-common/tasks/main.yml
  3. 11
      roles/container-engine/containerd-common/vars/debian.yml
  4. 8
      roles/container-engine/containerd-common/vars/fedora.yml
  5. 11
      roles/container-engine/containerd-common/vars/redhat.yml
  6. 11
      roles/container-engine/containerd-common/vars/ubuntu-amd64.yml
  7. 8
      roles/container-engine/containerd-common/vars/ubuntu-arm64.yml
  8. 3
      roles/container-engine/containerd/defaults/main.yml
  9. 3
      roles/container-engine/containerd/meta/main.yml
  10. 5
      roles/container-engine/containerd/tasks/crictl.yml
  11. 12
      roles/container-engine/containerd/vars/debian.yml
  12. 9
      roles/container-engine/containerd/vars/fedora.yml
  13. 12
      roles/container-engine/containerd/vars/redhat.yml
  14. 12
      roles/container-engine/containerd/vars/ubuntu-amd64.yml
  15. 1
      roles/container-engine/docker/meta/main.yml
  16. 2
      roles/container-engine/docker/tasks/main.yml
  17. 1
      roles/container-engine/docker/tasks/systemd.yml
  18. 2
      roles/container-engine/docker/vars/debian.yml
  19. 1
      roles/container-engine/docker/vars/fedora.yml
  20. 2
      roles/container-engine/docker/vars/redhat.yml
  21. 2
      roles/container-engine/docker/vars/ubuntu-amd64.yml
  22. 2
      roles/container-engine/docker/vars/ubuntu-arm64.yml

3
roles/container-engine/containerd-common/defaults/main.yml

@ -0,0 +1,3 @@
---
containerd_version: '1.2.13'
containerd_package: 'containerd.io'

19
roles/container-engine/containerd-common/tasks/main.yml

@ -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

11
roles/container-engine/containerd-common/vars/debian.yml

@ -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"

8
roles/container-engine/containerd-common/vars/fedora.yml

@ -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 }}"

11
roles/container-engine/containerd-common/vars/redhat.yml

@ -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"

11
roles/container-engine/containerd-common/vars/ubuntu-amd64.yml

@ -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"

8
roles/container-engine/containerd-common/vars/ubuntu-arm64.yml

@ -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"

3
roles/container-engine/containerd/defaults/main.yml

@ -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

3
roles/container-engine/containerd/meta/main.yml

@ -0,0 +1,3 @@
---
dependencies:
- role: container-engine/containerd-common

5
roles/container-engine/containerd/tasks/crictl.yml

@ -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

12
roles/container-engine/containerd/vars/debian.yml

@ -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:

9
roles/container-engine/containerd/vars/fedora.yml

@ -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:

12
roles/container-engine/containerd/vars/redhat.yml

@ -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:

12
roles/container-engine/containerd/vars/ubuntu-amd64.yml

@ -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
roles/container-engine/docker/meta/main.yml

@ -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"

2
roles/container-engine/docker/tasks/main.yml

@ -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:

1
roles/container-engine/docker/tasks/systemd.yml

@ -17,6 +17,7 @@
register: systemd_version
when: not is_ostree
changed_when: false
check_mode: false
- name: Write docker.service systemd file
template:

2
roles/container-engine/docker/vars/debian.yml

@ -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] }}"

1
roles/container-engine/docker/vars/fedora.yml

@ -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] }}"

2
roles/container-engine/docker/vars/redhat.yml

@ -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] }}"

2
roles/container-engine/docker/vars/ubuntu-amd64.yml

@ -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] }}"

2
roles/container-engine/docker/vars/ubuntu-arm64.yml

@ -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] }}"

Loading…
Cancel
Save