From 168a0ba85ddc8906a5304954d38fb2a074f38a98 Mon Sep 17 00:00:00 2001 From: Erin Sims Date: Sat, 1 Oct 2022 05:36:30 -0400 Subject: [PATCH] working on changes, and debugging --- playbooks/sshfs.yaml | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/playbooks/sshfs.yaml b/playbooks/sshfs.yaml index d7aedf1..386d021 100644 --- a/playbooks/sshfs.yaml +++ b/playbooks/sshfs.yaml @@ -54,27 +54,13 @@ loop: "{{ share }}" notify: - SSHFS - - name: setup mount sshfs - template: - src: ./sshfs.mount.j2 - dest: "/usr/lib/systemd/system/sshfs-{{ item }}.mount" - mode: 0644 - owner: root - group: root - loop: "{{ share }}" - notify: - - SSHFS - - name: "sshfs {{ item }} service start" - systemd: - name: "sshfs-{{ item }}" - state: started - enabled: yes - masked: no - daemon_reload: yes - loop: "{{ share }}" + - name: Ensure fstab has sshfs + ansible.builtin.lineinfile: + path: /etc/fstab + regexp: '^sshfs' + line: '{{ [username,'@',hostname,':',remotepath,item,'/',' ',localpath,item,'/' ]|join() }} fuse.sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/sshfs/.ssh/sshfs-key,allow_other,reconnect 0 0' handlers: - name: SSHFS - ansible.builtin.service: - name: sshfs {{ item }} service restart" - state: restarted - loop: "{{ share }}" + ansible.builtin.command: "mount {{ [ localpath,item,'/' ]|join() }}" + +