diff --git a/ansible/inventory/host_vars/asxpio-services.yaml b/ansible/inventory/host_vars/asxpio-services.yaml index 50000e7..9cbeb2d 100644 --- a/ansible/inventory/host_vars/asxpio-services.yaml +++ b/ansible/inventory/host_vars/asxpio-services.yaml @@ -5,7 +5,9 @@ wireguard_ip: "{{ asxpio_services_wireguard_ip }}" ssh_allow_public_git: false -s3fs_ensure_diskfree: 81920 # 80 GB free = max 80 GB cache +# s3fs is off: its cache took ~10 GB and nothing reads the mounts any more; +# restic and s3_replicate talk to object storage directly +s3fs_enabled: false # restic: ejabberd's Mnesia through its own backup command, its SQLite # through the online backup API. The Paper world is copied live (RCON is diff --git a/ansible/playbooks/03-setup-s3fs.yaml b/ansible/playbooks/03-setup-s3fs.yaml index 73e95ef..999fa07 100644 --- a/ansible/playbooks/03-setup-s3fs.yaml +++ b/ansible/playbooks/03-setup-s3fs.yaml @@ -72,63 +72,11 @@ ansible.builtin.debug: msg: "{{ df_output.stdout_lines | select('search', 's3fs') | list }}" - - name: Create immich library directory structure - ansible.builtin.file: - path: "{{ item }}" - state: directory - mode: '0775' - owner: root - group: docker - loop: - - /mnt/s3/immich/library - - /mnt/s3/immich/library/backups - - /mnt/s3/immich/library/encoded-video - - /mnt/s3/immich/library/library - - /mnt/s3/immich/library/profile - - /mnt/s3/immich/library/thumbs - - /mnt/s3/immich/library/upload - when: inventory_hostname in groups['services_servers'] - - name: Display post-setup information ansible.builtin.debug: - msg: | - ======================================== - S3FS Setup Complete on {{ inventory_hostname }}! - ======================================== - - ✅ All S3 buckets mounted successfully - - Mount points: - {% for bucket in s3_buckets %} - - {{ bucket.mount_point }} ({{ bucket.name }}) - {% endfor %} - - Cache configuration: - - Location: /var/cache/s3fs - - Max size: ~{{ (40 - (s3fs_ensure_diskfree / 1024)) | int }}GB - - Free space reserved: {{ (s3fs_ensure_diskfree / 1024) | int }}GB - - {% if inventory_hostname in groups['services_servers'] %} - Immich library structure created at: - /mnt/s3/immich/library/ - ├── backups/ - ├── encoded-video/ - ├── library/ - ├── profile/ - ├── thumbs/ - └── upload/ - - Next steps for Immich migration: - 1. Manually sync data from legacy server: - rsync -avz --info=progress2 \ - asxpio-old:/srv/immich/library/ \ - /mnt/s3/immich/library/ - - 2. Backup Immich PostgreSQL database on legacy server: - docker exec immich_postgres pg_dumpall -U postgres | gzip > /tmp/immich-db.sql.gz - - 3. Deploy Immich service configured to use S3 storage: - IMMICH_MEDIA_LOCATION=/mnt/s3/immich/library - {% endif %} - - ======================================== + msg: >- + {% if s3fs_enabled | default(true) | bool %}s3fs mounts on {{ inventory_hostname }}: + {{ s3_buckets | map(attribute='mount_point') | join(', ') }}, cache in + /var/cache/s3fs ({{ (s3fs_ensure_diskfree / 1024) | int }} GB kept free) + {% else %}s3fs is disabled on {{ inventory_hostname }}: mounts and + fstab lines removed{% endif %}