2022-10-30 07:56:06 -04:00
|
|
|
---
|
2022-10-30 08:56:21 -04:00
|
|
|
- name: install parted package
|
|
|
|
community.general.pacman:
|
|
|
|
name: parted
|
|
|
|
state: latest
|
|
|
|
update_cache: true
|
|
|
|
when:
|
|
|
|
- ansible_os_family == 'Archlinux'
|
2022-10-30 07:56:06 -04:00
|
|
|
|
2022-10-30 08:56:21 -04:00
|
|
|
- name: create containerd image partition
|
2022-10-30 07:56:06 -04:00
|
|
|
community.general.parted:
|
2022-10-30 08:56:21 -04:00
|
|
|
device: /dev/vdb
|
|
|
|
align: optimal
|
|
|
|
name: containerd
|
2022-10-30 07:56:06 -04:00
|
|
|
label: gpt
|
2022-10-30 08:56:21 -04:00
|
|
|
number: 1
|
|
|
|
part_start: 0%
|
|
|
|
part_end: 100%
|
|
|
|
state: present
|
|
|
|
fs_type: ext4
|
|
|
|
|
|
|
|
- name: create containerd partition filesystem
|
|
|
|
community.general.filesystem:
|
|
|
|
dev: /dev/disk/by-partlabel/containerd
|
|
|
|
fstype: ext4
|
|
|
|
resizefs: true
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: create containerd partition mount point
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /var/lib/containerd
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0664
|
|
|
|
|
|
|
|
- name: set startup mount config
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
state: present
|
|
|
|
path: /etc/fstab
|
|
|
|
insertafter: EOF
|
|
|
|
line: /dev/disk/by-partlabel/containerd /var/lib/containerd ext4 rw,relatime 0 1
|
|
|
|
|
|
|
|
- name: mount partitions
|
|
|
|
ansible.builtin.shell:
|
|
|
|
cmd: |
|
|
|
|
mount -a
|