You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-homelab/ansible/homelab/playbooks/mount-hdds.yml

54 lines
1.1 KiB
YAML

---
- hosts: servers
vars_files:
- ../variables.yml
become: true
tasks:
- name: Ensure /mnt/hdds directory
file:
path: /mnt/hdds
state: directory
- name: Unmount HDDS
ansible.posix.mount:
path: /mnt/hdds/
src: "UUID={{hdds_uuid}}"
fstype: ext4
state: unmounted
opts: defaults,nofail
- name: Make /mnt/hdds immutable
ansible.builtin.shell: chattr +i /mnt/hdds
- name: Mount HDDS
ansible.posix.mount:
path: /mnt/hdds
src: "UUID={{hdds_uuid}}"
fstype: ext4
state: mounted
opts: defaults,nofail
- name: Ensure /mnt/ssd0 directory
file:
path: /mnt/ssd0
state: directory
- name: Unmount SSD0
ansible.posix.mount:
path: /mnt/ssd0/
src: "UUID={{ssd0_uuid}}"
fstype: ext4
state: unmounted
opts: defaults,nofail
- name: Make /mnt/ssd0 immutable
ansible.builtin.shell: chattr +i /mnt/ssd0
- name: Mount SSD0
ansible.posix.mount:
path: /mnt/ssd0/
src: "UUID={{ssd0_uuid}}"
fstype: ext4
state: mounted
opts: defaults,nofail