Skip to content

Instantly share code, notes, and snippets.

@pwalkr
Last active June 4, 2022 01:17
Show Gist options
  • Save pwalkr/ebf312e00f4b42753a2c41f46721915a to your computer and use it in GitHub Desktop.
Save pwalkr/ebf312e00f4b42753a2c41f46721915a to your computer and use it in GitHub Desktop.
Ansible tasks to install containerd
# Input:
# containerd_version: 1.6.4
- name: download containerd
ansible.builtin.unarchive:
src: 'https://github.com/containerd/containerd/releases/download/v{{ containerd_version }}/containerd-{{ containerd_version }}-linux-{{ a[ansible_distribution].tar.gz'
dest: '/usr/local'
remote_src: yes
vars:
# Translate ansible_architecture to containerd arch
a:
x86_64: amd64
- name: download containerd.service
ansible.builtin.get_url:
url: 'https://raw.githubusercontent.com/containerd/containerd/v{{ containerd_version }}/containerd.service'
dest: '/usr/lib/systemd/system/containerd.service'
register: ctdsvc
- name: start containerd
ansible.builtin.systemd:
name: containerd
state: started
enabled: yes
daemon_reload: '{{ "yes" if ctdsvc is changed else "no" }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment