Update ansible code
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Adrien Reslinger 2022-08-16 16:52:29 +02:00
parent 505701376c
commit da38873dd7
Signed by: adrien
GPG key ID: DA7B27055C66D6DE
4 changed files with 34 additions and 31 deletions

View file

@ -1,2 +1,2 @@
---
containerd_debug: false
containerd_debug: false

View file

@ -1,4 +1,5 @@
---
- name: Restart containerd
service: name=containerd state=restarted
ansible.builtin.service:
name: containerd
state: restarted

View file

@ -6,11 +6,13 @@ galaxy_info:
galaxy_tags: []
license: GPL2
platforms:
- name: CentOS
version:
- 7
- 8
- name: RedHat
version:
- 7
- 8
- name: CentOS
version:
- 7
- 8
- 9
- name: RedHat
version:
- 7
- 8
- 9

View file

@ -1,23 +1,23 @@
---
- name: Include vars for {{ ansible_os_family }}
include_vars: "{{ ansible_os_family }}.yml"
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
- name: Add Official docker's repo
get_url:
ansible.builtin.get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docker-ce.repo
mode: 0644
when:
- ansible_os_family == "RedHat"
#- name: Remove all other's containerd version packages
# package:
# name: "{{ containerd_remove_packages_name }}"
# state: absent
# update_cache: yes
# - name: Remove all other's containerd version packages
# ansible.builtin.package:
# name: "{{ containerd_remove_packages_name }}"
# state: absent
# update_cache: true
- name: Create thin volumes for containerd
lvol:
community.general.lvol:
vg: "{{ item.vg }}"
lv: "{{ item.name }}"
thinpool: kubernetes
@ -26,14 +26,14 @@
- { name: var_lib_containerd, vg: vg_sys, size: 10g, mount_point: /var/lib/containerd, mount_opts: "discard"}
- name: create file system on containerd lv
filesystem:
community.general.filesystem:
fstype: ext4
dev: "/dev/{{ item.vg }}/{{ item.name }}"
with_items:
- { name: var_lib_containerd, vg: vg_sys, size: 10g, mount_point: /var/lib/containerd, mount_opts: "discard"}
- name: mount logical volumes
mount:
ansible.posix.mount:
name: "{{ item.mount_point }}"
src: "/dev/{{ item.vg }}/{{ item.name }}"
fstype: ext4
@ -43,20 +43,20 @@
- { name: var_lib_containerd, vg: vg_sys, size: 10g, mount_point: /var/lib/containerd, mount_opts: "discard"}
- name: Install containerd
package:
ansible.builtin.package:
name: "{{ containerd_package_name }}"
state: present
update_cache: yes
update_cache: true
notify: Restart containerd
- name: Enable containerd on boot
service:
ansible.builtin.service:
name: containerd
state: started
enabled: yes
enabled: true
- name: Configuring kernel module to be load on boot
template:
ansible.builtin.template:
src: "etc/modules-load.d/{{ item }}.conf.j2"
dest: "/etc/modules-load.d/{{ item }}.conf"
group: root
@ -67,7 +67,7 @@
- "overlay"
- name: Load kernel module
modprobe:
community.general.modprobe:
name: "{{ item }}"
state: present
with_items:
@ -75,7 +75,7 @@
- overlay
- name: Configure sysctl
sysctl:
ansible.posix.sysctl:
name: "{{ item }}"
value: "1"
sysctl_file: /etc/sysctl.d/99-kubernetes-cri.conf
@ -86,7 +86,7 @@
- "net.bridge.bridge-nf-call-ip6tables"
- name: Ensuring /etc/containerd folder exists
file:
ansible.builtin.file:
path: "/etc/containerd"
state: "directory"
group: root
@ -94,7 +94,7 @@
mode: 0755
- name: Configuring containerd
template:
ansible.builtin.template:
src: "etc/containerd/config.toml.j2"
dest: "/etc/containerd/config.toml"
group: root
@ -103,4 +103,4 @@
notify: Restart containerd
- name: Flush handlers
meta: flush_handlers
ansible.builtin.meta: flush_handlers