From 94e519c0c07781352a5e6cb2aedd1733caef362a Mon Sep 17 00:00:00 2001 From: Erin Sims Date: Mon, 26 Sep 2022 06:48:08 -0400 Subject: [PATCH] updated sshfs --- playbooks/sshfs.service.j2 | 38 ++++---------------------------------- playbooks/sshfs.yaml | 10 ++++++++-- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/playbooks/sshfs.service.j2 b/playbooks/sshfs.service.j2 index a82ac33..7169929 100644 --- a/playbooks/sshfs.service.j2 +++ b/playbooks/sshfs.service.j2 @@ -1,39 +1,9 @@ [Unit] -Description=Music Player Daemon -Documentation=man:mpd(1) man:mpd.conf(5) -Documentation=file:///usr/share/doc/mpd/html/user.html +Description=SSHFS Daemon After=network.target sound.target [Service] -Type=notify -EnvironmentFile=/etc/default/mpd -ExecStart=/usr/bin/mpd --no-daemon /etc/mpdf{{ item }}.conf - -# Enable this setting to ask systemd to watch over MPD, see -# systemd.service(5). This is disabled by default because it causes -# periodic wakeups which are unnecessary if MPD is not playing. -#WatchdogSec=120 - -# allow MPD to use real-time priority 40 -LimitRTPRIO=40 -LimitRTTIME=infinity - -# for io_uring -LimitMEMLOCK=64M - -# disallow writing to /usr, /bin, /sbin, ... -ProtectSystem=yes - -# more paranoid security settings -NoNewPrivileges=yes -ProtectKernelTunables=yes -ProtectControlGroups=yes -ProtectKernelModules=yes -# AF_NETLINK is required by libsmbclient, or it will exit() .. *sigh* -RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK -RestrictNamespaces=yes - -[Install] -WantedBy=multi-user.target -Also=mpd.socket +Type=simple +ExecStart=/usr/bin/sshfs -o allow_root "{{ [username,'@',hostname,':',localpath,item'/',' ',remotepath,item'/' ]|join() }}" +Restart=on-failure diff --git a/playbooks/sshfs.yaml b/playbooks/sshfs.yaml index 8ca473d..33b57ad 100644 --- a/playbooks/sshfs.yaml +++ b/playbooks/sshfs.yaml @@ -11,11 +11,17 @@ hostname: home.thrace-lan.info username: sshfs sshfsport: 2200 - - name: sshfs ansible.builtin.user: name: ssfs - + - name: sshfs mount + file: + path: "{{ localpath}}{{ item }}/" + state: directory + owner: root + group: root + mode: '0777' + loop: "{{ share }}" - name: setup service sshfs template: src: sshfs.service.j2