reoganize storage roles

This commit is contained in:
2022-12-05 23:18:04 +13:00
parent 3e70f70fa3
commit f230db3739
21 changed files with 17515 additions and 1 deletions

View File

@ -0,0 +1,38 @@
---
- name: create target directory for open-ebs files
become: false
ansible.builtin.file:
path: "{{ ansible_search_path[0] }}/files/ebs"
state: directory
mode: 0775
- name: download the open-ebs operator (lite) manifest
become: false
ansible.builtin.uri:
url: "https://openebs.github.io/charts/{{ item }}"
dest: "{{ ansible_search_path[0] }}/files/ebs/{{ item }}"
creates: "{{ ansible_search_path[0] }}/files/ebs/{{ item }}"
mode: 0664
with_items:
- openebs-operator-lite.yaml
- name: template out the open-ebs storage class definitions
ansible.builtin.template:
src: ebs_storage_class.yaml.j2
dest: "{{ ansible_search_path[0] }}/files/ebs/ebs_storage_class_{{ item }}.yaml"
with_items:
- ssd
- hdd
- name: install the open-ebs operator (lite)
kubernetes.core.k8s:
src: "{{ ansible_search_path[0] }}/files/ebs/openebs-operator-lite.yaml"
state: present
- name: install the open-ebs storage classes
kubernetes.core.k8s:
src: "{{ ansible_search_path[0] }}/files/ebs/ebs_storage_class_{{ item }}.yaml"
state: present
with_items:
- ssd
- hdd

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