From a7f197eda20eb7a729a793d3f476524df73c32b9 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 31 Oct 2022 01:56:21 +1300 Subject: [PATCH] container image disk config --- ansible/roles/vm_disks/tasks/main.yaml | 50 ++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/ansible/roles/vm_disks/tasks/main.yaml b/ansible/roles/vm_disks/tasks/main.yaml index d744900..0f5e29d 100644 --- a/ansible/roles/vm_disks/tasks/main.yaml +++ b/ansible/roles/vm_disks/tasks/main.yaml @@ -1,10 +1,48 @@ --- +- name: install parted package + become: true + community.general.pacman: + name: parted + state: latest + update_cache: true + when: + - ansible_os_family == 'Archlinux' -- name: create gpt labels +- name: create containerd image partition community.general.parted: - device: "{{ item }}" + device: /dev/vdb + align: optimal + name: containerd label: gpt - with_items: - - /dev/vdb - - /dev/vdc - - /dev/vdd \ No newline at end of file + 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 \ No newline at end of file