1
0
IaC/ansible/roles/k8s_storage_ebs_deploy/tasks/nodes.yaml

60 lines
1.3 KiB
YAML
Raw Normal View History

2022-11-09 07:09:46 -05:00
---
# - name: create mount directories for ebs drives
# ansible.builtin.file:
# path: "{{ item }}"
# state: directory
# owner: root
# group: root
# mode: 0775
# with_items:
# - /ebs
# - /ebs/ssd
# - /ebs/hdd
- name: ensure parted is installed
community.general.pacman:
name: parted
state: latest
update_cache: true
when:
- ansible_os_family == 'Archlinux'
- name: create containerd image partition
community.general.parted:
device: "{{ item.disk }}"
align: optimal
name: "{{ item.part }}"
label: gpt
number: 1
part_start: 0%
part_end: 100%
state: present
fs_type: ext4
with_items:
- disk: /dev/vdc
part: ebs-ssd
- disk: /dev/vdd
part: ebs-hdd
- name: create containerd partition filesystem
community.general.filesystem:
dev: "{{ item }}"
fstype: ext4
resizefs: true
state: present
with_items:
- /dev/disk/by-partlabel/ebs-ssd
- /dev/disk/by-partlabel/ebs-hdd
- name: mount ebs disks
ansible.posix.mount:
state: mounted
src: "{{ item.src }}"
path: "{{ item.path }}"
fstype: ext4
boot: true
with_items:
- src: /dev/disk/by-partlabel/ebs-ssd
path: /ebs/ssd
- src: /dev/disk/by-partlabel/ebs-hdd
path: /ebs/hdd