saltyorg / Saltbox

Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
https://docs.saltbox.dev
GNU General Public License v3.0
574 stars 65 forks source link

Multiple remotes #26

Closed saltydk closed 1 year ago

saltydk commented 2 years ago

Tweak settings.yml remote variable to either be a list or provide some other way of mounting multiple mounts. Either defaulting to a union or creating a dictionary so you select the mount profiles per remote.

saltydk commented 1 year ago

Suggested config format

rclone:
  version: latest
  remotes:
    - remote: google
      type: google
      cache: false
      port: 5572
    - remote: dropbox
      type: dropbox
      cache: false
      port: 5573
    - remote: feeder
      type: sftp
      cache: false
      port: 5574
saltydk commented 1 year ago

Prompt for remote type when migrating the config instead of relying on a lookup that could break down the line

- name: Prompt for something
  ansible.builtin.pause:
    prompt: "Enter something"
    echo: true
  register: pause_prompt

- name: Set something
  ansible.builtin.set_fact:
    something: "{{ pause_prompt.user_input }}"

- name: Debug
  ansible.builtin.debug:
    var: something
saltydk commented 1 year ago

Template ended up being

rclone:
  version: latest
  remotes:
    - remote: google
      template: google
      cache:
        enabled: false
        size: 50G
        max_age: 504h
      port: 5572

Migration will just assume google template for now as that is the simplest solution.

New folder layout will ditch /mnt/feeder and place the remote(s) in /mnt/remote/ and mergerfs branches will be added dynamically, hence me questioning if we should keep mounts_override.

This change of layout is likely a non-trivial change that may require some manual intervention for people with feeder mounts currently or other complex setups that may benefit from migrating to this new way of dealing with multiple remotes without using union.

TODO:

If anyone has any suggestions now would be the time before we lock in the new format.

saltydk commented 1 year ago

Disabling remote logic will be done like so:

rclone:
  version: latest
  remotes: []
saltydk commented 1 year ago

Implemented in the traefik3 branch.