ansible-role-containerd/tasks/main.yml
Adrien 32e46c10fe
All checks were successful
continuous-integration/drone/push Build is passing
fix lint
2020-06-04 21:21:06 +02:00

69 lines
1.5 KiB
YAML

---
- name: Include vars for {{ ansible_os_family }}
include_vars: "{{ ansible_os_family }}.yml"
- name: Remove all other's containerd version packages
package:
name: "{{ containerd_remove_packages_name }}"
state: absent
update_cache: yes
- name: Install containerd
package:
name: "{{ containerd_package_name }}"
state: present
update_cache: yes
notify: Restart containerd
- name: Enable containerd on boot
service:
name: containerd
state: started
enabled: yes
- name: Configuring kernel module to be load on boot
template:
src: "etc/modules-load.d/{{ item }}.conf.j2"
dest: "/etc/modules-load.d/{{ item }}.conf"
group: root
owner: root
mode: 0644
with_items:
- "br_netfilter"
- "overlay"
- name: Load kernel module
modprobe:
name: "{{ item }}"
state: present
with_items:
- br_netfilter
- overlay
- name: Configure sysctl
sysctl:
name: "{{ item }}"
value: "1"
sysctl_file: /etc/sysctl.d/99-kubernetes-cri.conf
reload: yes
with_items:
- "net.bridge.bridge-nf-call-iptables"
- "net.ipv4.ip_forward"
- "net.bridge.bridge-nf-call-ip6tables"
- name: Ensuring /etc/containerd folder exists
file:
path: "/etc/containerd"
state: "directory"
group: root
owner: root
mode: 0755
- name: Configuring containerd
template:
src: "etc/containerd/config.toml.j2"
dest: "/etc/containerd/config.toml"
group: root
owner: root
mode: 0644
notify: Restart containerd