this post was submitted on 07 May 2024
88 points (97.8% liked)

Selfhosted

62724 readers
492 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:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

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

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

After getting fed up with TrueNAS (after it borked itself for the third time and I would have had to set it up AGAIN) I decided to learn Ansible and write a playbook to setup my homeserver that way.

I wanted to share this playbook with you in case someone might find it useful for their own setup and maybe someone has some tips on things I could improve.

This server will not be exposed to the public/internet. If I want to access a service on it from outside my home network I have Wireguard setup on my router to connect to my home network from anywhere.

Keep in mind that I'm relatively new to sysadmin stuff etc so don't be too harsh please ๐Ÿ˜…

you are viewing a single comment's thread
view the rest of the comments
[โ€“] idefix@sh.itjust.works 4 points 2 years ago (2 children)

Nice, well done. I wish I could find the same for Debian.

[โ€“] BrianTheeBiscuiteer@lemmy.world 7 points 2 years ago (2 children)
[โ€“] k_rol@lemmy.ca 1 points 2 years ago

Thx I had no idea!

[โ€“] Tywele@lemmy.dbzer0.com 3 points 2 years ago (1 children)

It should be pretty easy to adapt it for Debian. The only thing you need to change as far as I can see is the usage of the dnf module to the apt module.

[โ€“] vortexsurfer@lemmy.world 2 points 2 years ago (1 children)

If you want to make your playbooks/roles more universal, there's a generic package module which will figure out what package manager to use based on the detected OS.

Or, if that doesn't fit your needs, you can add conditions to tasks (or blocks of tasks), like

when: ansible_os_family == "Debian"

and use that for tasks specific to a given Linux distro/family.

Ansible will detect a lot of info about each host and make it available as facts. See for example https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html

[โ€“] Tywele@lemmy.dbzer0.com 1 points 2 years ago

I know but I also learned that it's generally better to use the specific module for the package manager (just can't remember why from the top of my head) and I never intended this playbook to be generally usable.