Created
March 8, 2023 03:55
-
-
Save acmiyaguchi/dd55b6261a8d0d3efbb8ac0cd21f307a to your computer and use it in GitHub Desktop.
Revisions
-
acmiyaguchi created this gist
Mar 8, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ - name: set ssd mount point variable set_fact: ssd_mount_point: /mnt/ssd ssd_device: /dev/sdb - name: check if ssd is mounted become: true shell: mount | grep {{ ssd_mount_point }} register: ssd_mounted ignore_errors: true - name: configure local-ssd become: true when: ssd_mounted.rc != 0 block: - name: format local-ssd shell: mkfs.ext4 -F {{ ssd_device }} - name: create local-ssd mount point file: path: "{{ ssd_mount_point }}" state: directory - name: mount local-ssd mount: path: "{{ ssd_mount_point }}" src: "{{ ssd_device }}" fstype: ext4 state: mounted - name: add fstab entry for local-ssd lineinfile: path: /etc/fstab line: "{{ ssd_device }} {{ ssd_mount_point }} ext4 defaults 0 0" state: present create: yes