GitHub - Tywele/ansible_homeserver
github.com
external-link
Contribute to Tywele/ansible_homeserver development by creating an account on GitHub.

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 😅

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

Tywèle [she|her]
creator
link
fedilink
English
14M

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.

Create a post

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!

  • 1 user online
  • 279 users / day
  • 589 users / week
  • 1.34K users / month
  • 4.55K users / 6 months
  • 1 subscriber
  • 3.49K Posts
  • 69.8K Comments
  • Modlog