this post was submitted on 28 Apr 2024
12 points (92.9% liked)

Selfhosted

40296 readers
344 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

cross-posted from: https://lemmy.dbzer0.com/post/19310012

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.

top 3 comments
sorted by: hot top controversial new old
[–] mojo_raisin@lemmy.world 4 points 6 months ago
[–] Max_P@lemmy.max-p.me 4 points 6 months ago

There's always the command escape hatch. Ultimately the roles you'll use will probably do the same. Even a plugin would do the same, all the ZFS tooling eventually shells to the zfs/zpool, probably same with btrfs. Those are just very complex filesystems, it would be unreliable to reimplement them in Python.

We use tools to solve problems, not make it harder for no reason. That's why command/shell actions exist: sometimes it's just better to go that way.

You can always make your own plugin for it, but you're still just writing extra code to eventually still shell out into the commands and parse their output.

[–] possiblylinux127@lemmy.zip 2 points 6 months ago* (last edited 6 months ago)

For one, use BTRFS as it is built in and doesn't break with updates. (Btrfs does have limitations)

For ansible, just format the disks from the command line. (You can run commands from ansible)