Ansible repo for digital ocean projects
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

sshfs.yaml 1.1 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ---
  2. - hosts: mpdb
  3. vars:
  4. share:
  5. - 'MUSIC'
  6. - 'MOVIES'
  7. localpath: '/mnt/'
  8. remotepath: '/pool/'
  9. hostname: "home.thrace-lan.info"
  10. username: "sshfs"
  11. sshfsport: 2200
  12. tasks:
  13. - name: sshfs
  14. ansible.builtin.user:
  15. name: ssfs
  16. - name: copy private key
  17. copy:
  18. src: "./sshfs-key"
  19. dest: "/home/sshfs/.ssh/"
  20. owner: sshfs
  21. group: sshfs
  22. mode: '0700'
  23. - name: "sshfs mount {{ item }}"
  24. file:
  25. path: "{{ localpath}}{{ item }}/"
  26. state: directory
  27. owner: root
  28. group: root
  29. mode: '0777'
  30. loop: "{{ share }}"
  31. - name: setup service sshfs
  32. template:
  33. src: sshfs.service.j2
  34. dest: "/usr/lib/systemd/system/sshfs-{{ item }}.service"
  35. mode: 0644
  36. owner: root
  37. group: root
  38. loop: "{{ share }}"
  39. - name: "Sshfs {{ item }} service start"
  40. systemd:
  41. name: "sshfs-{{ item }}"
  42. state: started
  43. enabled: yes
  44. masked: no
  45. daemon_reload: yes
  46. loop: "{{ share }}"