I'm looking to migrate to systemd's automount from autofs.
One neat thing about autofs was that with the help of auto.smb, it was possible for autofs to automount on demand all the shares on a server just by creating a credentials file for that server:
sudo mkdir -p /etc/creds
printf "username=user\npassword=***\n" | sudo tee -a /etc/creds/nas
#update creds file with NAS password
sudo chmod 0400 /etc/creds/nas
echo "/cifs /etc/autofs/auto.smb --timeout=300" | sudo tee -a /etc/autofs/auto.master
sudo systemctl enable --now autofs
ll /cifs/nas/<share> #works for any valid share
Is anything like this possible using systemd's automount?