Skip to content

Commit

Permalink
Revise raid startup script
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssa-sm committed Jul 22, 2024
1 parent 703abaf commit 3d6e0ca
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions modules/scripts/startup-script/files/setup-raid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@
DST_MNT: "/mnt/localssd"
bashrc: "{{ '/etc/bashrc' if ansible_facts['os_family'] == 'RedHat' else '/etc/bash.bashrc' }}"
array_dev: "/dev/md0"
mode: 755
mode: '0755'
tasks:
- name: Check if DST_MNT exists
ansible.builtin.stat:
path: "{{ DST_MNT }}"
register: dst_mnt_exists

- name: Check if {{ array_dev }} exists
ansible.builtin.stat:
path: "{{ array_dev }}"
Expand Down Expand Up @@ -78,19 +73,16 @@
ansible.builtin.shell:
cmd: tune2fs /dev/md0 -r 131072

- name: Add a label
ansible.builtin.shell: e2label /dev/md0 LOCALSSD

- name: Create mount point
ansible.builtin.file:
path: "{{ DST_MNT }}"
state: directory
mode: "{{ mode }}"

- name: Mount RAID array
ansible.posix.mount:
src: /dev/md0
path: "{{ DST_MNT }}"
fstype: ext4
opts: discard,defaults,nofail
state: mounted

- name: Set mount permissions
ansible.builtin.file:
path: "{{ DST_MNT }}"
state: directory
mode: "{{ mode }}"

0 comments on commit 3d6e0ca

Please sign in to comment.