feat: Set up filesystems
Automatically set up btrfs root and data filesystem, as well as external HDD. This automation change assumes a layout exactly as in current bob to function by default, can be changed to any btrfs layout with the `btrfs_mounts` configuration option, however.
This commit is contained in:
parent
a217d65640
commit
bb9de502ce
6 changed files with 112 additions and 0 deletions
30
roles/filesystem/tasks/main.yaml
Normal file
30
roles/filesystem/tasks/main.yaml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
- name: Ensure btrfs ROOT layout
|
||||
community.general.btrfs_subvolume:
|
||||
name: "/{{ item.subvol }}"
|
||||
# filesystem_device: /dev/sdb1
|
||||
# fileystem_label: btrfs-root # only 1 of the 3 required
|
||||
filesystem_uuid: "{{ item.uuid }}"
|
||||
loop: "{{ btrfs_mounts }}"
|
||||
become: true
|
||||
|
||||
- name: Ensure fstab contains btrfs mount entries
|
||||
ansible.posix.mount:
|
||||
path: "{{ item.path }}"
|
||||
src: "UUID={{ item.uuid }}"
|
||||
fstype: btrfs
|
||||
opts: "{{ item.opts }},subvol={{ item.subvol }}"
|
||||
state: present
|
||||
loop: "{{ btrfs_mounts }}"
|
||||
become: true
|
||||
notify: Reboot machine
|
||||
|
||||
- name: Ensure external HDD is mounted
|
||||
ansible.posix.mount:
|
||||
path: /mnt/ext
|
||||
src: "UUID=01b221f2-83a5-49e4-bdef-ee9ee9ac5310"
|
||||
fstype: ext4
|
||||
opts: "noatime"
|
||||
state: present
|
||||
become: true
|
||||
when: "should_mount_external_hdd"
|
||||
Loading…
Add table
Add a link
Reference in a new issue