feat: update SSHFS task to use 'mount -a' and improve failure handling
Some checks failed
Nix Format Check / check-format (push) Failing after 42s
Some checks failed
Nix Format Check / check-format (push) Failing after 42s
This commit is contained in:
parent
e6283d1c55
commit
b669a8c2c9
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user