added ebs hostpath storage

This commit is contained in:
2022-11-10 01:09:46 +13:00
parent e5fdf35669
commit 3e70f70fa3
15 changed files with 125 additions and 16516 deletions

View File

@ -0,0 +1,60 @@
---
# - 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