Skip to content

Commit

Permalink
fixed ftype. Errors with multiple volumes.
Browse files Browse the repository at this point in the history
  • Loading branch information
XaverStiensmeier committed Jun 4, 2024
1 parent 308722b commit 23fe109
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
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 }}"
32 changes: 4 additions & 28 deletions resources/playbook/roles/bibigrid/tasks/020-disk-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,7 @@
- "{{ master.disks }}"
when: master.disks is defined

- when: volumes is defined and auto_mount
block:
- name: Make sure disks are available
failed_when: false
filesystem:
fstype: ext4
dev: "{{ item.device }}"
force: false
state: present
with_items: "{{ volumes }}"

- name: Create mount folders if they don't exist
failed_when: false
file:
path: "/{{ item.name }}"
state: directory
mode: '0755'
owner: root
group: '{{ ansible_distribution | lower }}'
with_items: "{{ volumes }}"

- name: Mount disks
failed_when: false
mount:
path: "{{ item.name }}"
src: "{{ item.device }}"
state: mounted
with_items: "{{ volumes }}"
- name: Automount
when: volumes is defined and auto_mount
include_tasks: 020-disk-server-automount.yml
with_items: "{{ volumes }}"

Check failure on line 23 in resources/playbook/roles/bibigrid/tasks/020-disk-server.yml

View workflow job for this annotation

GitHub Actions / linting-job

yaml[new-line-at-end-of-file]

No new line character at the end of file

0 comments on commit 23fe109

Please sign in to comment.