feat: update SSHFS task to use 'mount -a' and improve failure handling
Some checks failed
Nix Format Check / check-format (push) Failing after 42s

This commit is contained in:
Menno van Leeuwen 2025-03-11 22:07:01 +01:00
parent e6283d1c55
commit b669a8c2c9
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE

View File

@ -39,12 +39,14 @@
state: present
regexp: "^sshfs#.*{{ remote_path }}"
backup: true
register: fstab_update
notify: Systemctl daemon-reload
- name: Mount SSHFS filesystem
- name: Mount filesystems
become: true
ansible.builtin.command:
cmd: "sshfs {{ sshfs_user }}@{{ sshfs_host }}:/ {{ remote_path }} -o port={{ sshfs_port }},password_stdin,_netdev,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3"
stdin: "{{ sshfs_pass }}"
cmd: "mount -a"
register: mount_result
changed_when: mount_result.rc == 0
failed_when: mount_result.rc != 0 and "already mounted" not in mount_result.stderr
failed_when: mount_result.rc != 0
when: fstab_update.changed