[Help] Which modules for BTRFS or ZFS setup with Ansible?

Hello,

I need some help here. I’ve been trying to write my own Ansible playbook to setup my homeserver. The storage devices on this server are 1 NVMe SSD and 2 HDDs which I want to setup as a mirror. I want to setup all storage devices as either BTRFS or ZFS but I’m having trouble finding the correct modules to use in Ansible for this.

I have also found some roles in Ansible Galaxy but those are either not explained enough for me to use and seem overwhelming to use (especially in comparison to the terminal commands that are needed to setup the BTRFS volumes or ZFS pools). But just using the builtin command module in Ansible somehow feels wrong and not the right way to go about this.

Can someone point me in the right direction? Right now I think I will prefer using BTRFS.

Toribor,
@Toribor@corndog.social avatar

I couldn’t find any ansible modules for managing ZFS so I ended up doing it using the command module which is rather clunky and prone to exceptions I hadn’t thought of.


<span style="color:#323232;">- name: Import zfs pool
</span><span style="color:#323232;">  ansible.builtin.command: "zpool import -d /dev/disk/by-id {{ item.name }}"
</span><span style="color:#323232;">  become: true
</span><span style="color:#323232;">  register: import_result
</span><span style="color:#323232;">  changed_when: import_result.rc == 0
</span>
Tywele,

I have done the same just with Btrfs now.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • ansible@lemmy.world
  • Durango
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • khanakhh
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • everett
  • ngwrru68w68
  • kavyap
  • InstantRegret
  • JUstTest
  • cubers
  • GTA5RPClips
  • cisconetworking
  • ethstaker
  • osvaldo12
  • modclub
  • normalnudes
  • provamag3
  • tester
  • anitta
  • Leos
  • megavids
  • lostlight
  • All magazines