This project automates the process of mounting storage via SSH and performing additional checks to ensure that mounts are available and SSH connectivity is stable. It uses rclone
and bindfs
for managing the mounts and provides systemd services for automating the startup and monitoring of the mounts.
Before you start the installation, you must configure the variables in the group_vars/all.yml
file. This file contains essential settings for the mounts, users, and systemd services.
- SSH Details: Update
sftp_host
,sftp_user
,sftp_port
, andhetzner_crypt_password
with your specific credentials for mounting the SFTP. - Mount Points: Define your main
mount_point
and subdirectories in thesubs
section for proper bind mounting. - Email Setup: Set up the email recipient (
sendmail_recipient
) to get notifications if something fails.
-
Run the Ansible playbook to install the necessary components:
ansible-playbook main.yml
-
To uninstall the components:
ansible-playbook main-uninstall.yml
During the installation process, the following actions are performed:
- Installs the required packages,
rclone
andbindfs
. - Copies the mount and check scripts to the designated script directory.
- Configures and enables the
mount-storage
systemd service, which ensures the mounts are properly handled on startup.
The uninstallation process will:
- Stop and disable the
mount-storage
systemd service. - Remove the mount and check scripts.
- Remove the rclone configuration and other related files.
- Mind: rclone and bindfs will not be uninstalled, as it may be used for other purposes.
This provides a clean removal of the automated mount storage setup.