Skip to content

darkwizard242/ansible-role-containerd

Repository files navigation

build-test release Ansible Role Maintainability Rating Reliability Rating Security Rating GitHub tag (latest SemVer) GitHub repo size

Ansible Role: containerd

Role to install (by default) containerd on Debian/Ubuntu and EL systems. Containerd is "An industry-standard container runtime with an emphasis on simplicity, robustness and portability".

Requirements

None.

Role Variables

Available variables are listed below (located in defaults/main.yml):

Variables list:

containerd_app: containerd
containerd_version: 2.0.1
containerd_os: "{{ ansible_system | lower }}"
containerd_architecture_map:
  amd64: amd64
  arm: arm64
  x86_64: amd64
  armv6l: armv6
  armv7l: armv7
  aarch64: arm64
  32-bit: "386"
  64-bit: amd64
containerd_dl_url: "https://github.com/{{ containerd_app }}/{{ containerd_app }}/releases/download/v{{ containerd_version }}/{{ containerd_app }}-{{ containerd_version }}-{{ containerd_os }}-{{ containerd_architecture_map[ansible_architecture] }}.tar.gz"
containerd_bin_path: /usr/local/bin
containerd_files_mode: '0755'
containerd_files_owner: root
containerd_files_group: root
containerd_systemd_service_setup: true
containerd_systemd_template_in_file: containerd.service.j2
containerd_systemd_template_out_dir: /etc/systemd/system
containerd_systemd_template_out_file: containerd.service
containerd_systemd_service_enable_state: yes
containerd_systemd_service_state: started

Variables table:

Variable Description
containerd_app Defines the app to install i.e. containerd
containerd_version Defined to dynamically fetch the desired version to install. Defaults to: 2.0.1
containerd_os Defines OS type.
containerd_architecture_map Defines os architecture. Used for obtaining the correct type of binaries based on OS System Architecture.
containerd_dl_url Defines URL to download the containerd binaries archive from.
containerd_bin_path Defined to dynamically set the appropriate path to store containerd binaries into.
containerd_files_mode Mode for the binaries file of containerd.
containerd_files_owner Owner for the binaries file of containerd.
containerd_files_group Group for the binaries file of containerd.
containerd_systemd_service_setup Boolean for whether systemd service setup (systemd service generation, systemd boot start and state change) for containerd needs to be performed.
containerd_systemd_template_in_file Template (Jinja) file to use as source for containerd's systemd service.
containerd_systemd_template_out_dir Destination directory to store the generated Jinja template for containerd's systemd service.
containerd_systemd_template_out_file Destination filename for containerd's systemd service.
containerd_systemd_service_enable_state Defined to enable containerd systemd service at boot.
containerd_systemd_service_state Defined to set the state of the containerd systemd service

Dependencies

None

Example Playbook

For default behaviour of role (i.e. installation of containerd) in ansible playbooks.

- hosts: servers
  roles:
    - darkwizard242.containerd

For customizing behavior of role (i.e. specifying the desired containerd version) in ansible playbooks.

- hosts: servers
  roles:
    - darkwizard242.containerd
  vars:
    containerd_version: 1.5.6

For customizing behavior of role (i.e. setting path for extraction to /usr/bin) in ansible playbooks.

- hosts: servers
  roles:
    - darkwizard242.containerd
  vars:
    containerd_bin_path: '/usr/bin'

License

MIT

Author Information

This role was created by Ali Muhammad