-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed ftype. Errors with multiple volumes.
- Loading branch information
1 parent
308722b
commit 23fe109
Showing
2 changed files
with
36 additions
and
28 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
resources/playbook/roles/bibigrid/tasks/020-disk-server-automount.yml
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
- block: | ||
- name: Make sure disks are available | ||
failed_when: false | ||
filesystem: | ||
fstype: ext4 | ||
dev: "{{ item.device }}" | ||
force: false | ||
state: present | ||
|
||
- name: Get the filesystem type of the device using lsblk | ||
command: "lsblk -no FSTYPE {{ item.device }}" | ||
register: filesystem_type | ||
changed_when: false | ||
|
||
- name: Log the filesystem type | ||
debug: | ||
msg: "Filesystem type is {{ filesystem_type.stdout }}" | ||
|
||
- name: Create mount folders if they don't exist | ||
file: | ||
path: "/vol/{{ item.name }}" | ||
state: directory | ||
mode: '0755' | ||
owner: root | ||
group: '{{ ansible_distribution | lower }}' | ||
|
||
- name: Mount disks | ||
mount: | ||
path: "/vol/{{ item.name }}" | ||
src: "{{ item.device }}" | ||
state: mounted | ||
fstype: "{{ filesystem_type.stdout }}" |
This file contains 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 characters