• 0 Posts
  • 19 Comments
Joined 1 year ago
cake
Cake day: July 23rd, 2023

help-circle









  • In my opinion trying to set up a highly available fault tolerant homelab adds a large amount of unnecessary complexity without an equivalent benefit. It’s good to have redundancy for essential services like DNS, but otherwise I think it’s better to focus on a robust backup and restore process so that if anything goes wrong you can just restore from a backup or start containers on another node.

    I configure and deploy all my applications with Ansible roles. It can programmatically create config files, pass secrets, build or start containers, cycle containers automatically after config changes, basically everything you could need.

    Sure it would be neat if services could fail over automatically but things only ever tend to break when I’m making changes anyway.







  • Sure. Below is an example playbook that is fairly similar to how I’m deploying most of my containers.

    This example creates a folder for samba data, creates a config file from a template and then runs the samba container. It even has a handler so that if I make changes to the config file template it will cycle the container for me after deploying the updated config file.

    I usually structure everything as an ansible role which just splits up this sort of playbook into a folder structure instead. ChatGPT did a great job of helping me figure out where to put files and generally just sped up the process of me creating tasks to do common things like setup a cronjob, install a package, or copy files around.

    - name: Run samba
      hosts: servername
    
      vars:
        samba_data_directory: "/home/me/docker/samba"
    
      tasks:
      - name: Create samba data directory
        ansible.builtin.file:
          path: "{{ samba_data_directory }}"
          state: directory
          mode: '0755'
    
      - name: Create samba config from a jinja template file
        ansible.builtin.template:
          src: templates/smb.conf.j2
          dest: "{{ samba_data_directory }}/smb.conf"
          mode: '0644'
        notify: Restart samba container
    
      - name: Run samba container
        community.docker.docker_container:
          name: samba
          image: dperson/samba
          ports:
            - 445:445
          volumes:
            - "{{ samba_data_directory}}:/etc/samba/"
            - "/home/me/samba_share:/samba_share"
          env:
            TZ: "America/Chicago"
            UID: '1000'
            GUID: '1000'
            USER: "me;mysambapassword"
            WORKERGROUP: "my-samba-workergroup"
          restart_policy: unless-stopped
    
      handlers:
      - name: Restart samba container
        community.docker.docker_container:
          name: samba
          restart: true
    
    



  • Standing up email might not be that hard… but it’s much harder to ensure that your mail will actually be delivered successfully. Plus it’s not a service you can typically afford to go down. Any emails you miss during that downtime are gone forever, whereas even if my Vaultwarden credential vault goes down I can access passwords from a device that has things cached at least while I fix things.

    Plus the big providers just treat small mail servers with a lot more skepticism than they did 20 years ago.