Update ansible code
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
a1adffbf4c
commit
1e20bf368e
3 changed files with 132 additions and 131 deletions
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
- name: Restart cri-o
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: crio
|
||||
state: restarted
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ galaxy_info:
|
|||
version:
|
||||
- 7
|
||||
- 8
|
||||
- 9
|
||||
- name: RedHat
|
||||
version:
|
||||
- 7
|
||||
- 8
|
||||
- 9
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
- name: CRI-O setup
|
||||
block:
|
||||
- name: Include vars for {{ ansible_os_family }}
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: Create thin volumes for containers
|
||||
lvol:
|
||||
community.general.lvol:
|
||||
vg: "{{ item.vg }}"
|
||||
lv: "{{ item.name }}"
|
||||
thinpool: kubernetes
|
||||
|
|
@ -14,14 +14,14 @@
|
|||
- { name: var_lib_containers, vg: vg_sys, size: "{{ lv_containers_size | default('10g') }}", mount_point: /var/lib/containers, mount_opts: "discard"}
|
||||
|
||||
- name: create file system on containers lv
|
||||
filesystem:
|
||||
community.general.filesystem:
|
||||
fstype: ext4
|
||||
dev: "/dev/{{ item.vg }}/{{ item.name }}"
|
||||
with_items:
|
||||
- { name: var_lib_containers, vg: vg_sys, size: "{{ lv_containers_size | default('10g') }}", mount_point: /var/lib/containers, mount_opts: "discard"}
|
||||
|
||||
- name: mount logical volumes
|
||||
mount:
|
||||
ansible.posix.mount:
|
||||
name: "{{ item.mount_point }}"
|
||||
src: "/dev/{{ item.vg }}/{{ item.name }}"
|
||||
fstype: ext4
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
- { name: var_lib_containers, vg: vg_sys, size: "{{ lv_containers_size | default('10g') }}", mount_point: /var/lib/containers, mount_opts: "discard"}
|
||||
|
||||
- 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
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
- "overlay"
|
||||
|
||||
- name: Load kernel module
|
||||
modprobe:
|
||||
community.general.modprobe:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
|
|
@ -50,66 +50,66 @@
|
|||
- overlay
|
||||
|
||||
- name: Configure sysctl
|
||||
sysctl:
|
||||
ansible.posix.sysctl:
|
||||
name: "{{ item }}"
|
||||
value: "1"
|
||||
sysctl_file: /etc/sysctl.d/99-kubernetes-cri.conf
|
||||
reload: yes
|
||||
reload: true
|
||||
with_items:
|
||||
- "net.bridge.bridge-nf-call-iptables"
|
||||
- "net.ipv4.ip_forward"
|
||||
- "net.bridge.bridge-nf-call-ip6tables"
|
||||
|
||||
- name: Install dnf-plugins-core package
|
||||
package:
|
||||
ansible.builtin.package:
|
||||
name: dnf-plugins-core
|
||||
state: present
|
||||
- name: Add container-selinux repository
|
||||
command:
|
||||
ansible.builtin.command:
|
||||
cmd: dnf -y copr enable rhcontainerbot/container-selinux
|
||||
creates: /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:rhcontainerbot:container-selinux.repo
|
||||
warn: no
|
||||
- name: Install container-selinux GPG key
|
||||
rpm_key:
|
||||
ansible.builtin.rpm_key:
|
||||
key: "https://download.copr.fedorainfracloud.org/results/rhcontainerbot/container-selinux/pubkey.gpg"
|
||||
state: present
|
||||
|
||||
- name: Registering libcontainers repository
|
||||
get_url:
|
||||
ansible.builtin.get_url:
|
||||
url: https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_{{ ansible_distribution_major_version }}/devel:kubic:libcontainers:stable.repo
|
||||
dest: /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
- name: Install libcontainers GPG key
|
||||
rpm_key:
|
||||
ansible.builtin.rpm_key:
|
||||
key: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_{{ ansible_distribution_major_version }}/repodata/repomd.xml.key"
|
||||
state: present
|
||||
|
||||
- name: Registering CRI-O {{ crio_version }} repository
|
||||
get_url:
|
||||
ansible.builtin.get_url:
|
||||
url: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_version }}/CentOS_{{ ansible_distribution_major_version }}/devel:kubic:libcontainers:stable:cri-o:{{ crio_version }}.repo"
|
||||
dest: "/etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:{{ crio_version }}.repo"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
- name: Install CRI-O GPG key
|
||||
rpm_key:
|
||||
ansible.builtin.rpm_key:
|
||||
key: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_version }}/CentOS_{{ ansible_distribution_major_version }}/repodata/repomd.xml.key"
|
||||
state: present
|
||||
|
||||
- name: Update package manager list
|
||||
package:
|
||||
update_cache: yes
|
||||
ansible.builtin.package:
|
||||
update_cache: true
|
||||
|
||||
- name: Install cri-o package
|
||||
package:
|
||||
ansible.builtin.package:
|
||||
name: "{{ crio_package_name }}"
|
||||
state: present
|
||||
notify: Restart cri-o
|
||||
|
||||
- name: Ensuring /etc/crio/crio.conf.d folder exists
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "/etc/crio/crio.conf.d"
|
||||
state: "directory"
|
||||
group: root
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
mode: 0755
|
||||
|
||||
- name: Configuring cri-o
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "etc/crio/crio.conf.d/{{ item }}.j2"
|
||||
dest: "/etc/crio/crio.conf.d/{{ item }}"
|
||||
group: root
|
||||
|
|
@ -132,10 +132,10 @@
|
|||
notify: Restart cri-o
|
||||
|
||||
- name: Enable cri-o on boot
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: crio
|
||||
state: restarted
|
||||
enabled: yes
|
||||
enabled: true
|
||||
|
||||
tags:
|
||||
- crio
|
||||
Loading…
Add table
Add a link
Reference in a new issue