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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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: sshfs
  16. state: present
  17. group: sshfs
  18. - name: copy private key
  19. copy:
  20. src: "./sshfs-key"
  21. dest: "/home/sshfs/.ssh/"
  22. owner: sshfs
  23. group: sshfs
  24. mode: '0700'
  25. - name: "sshfs mount {{ item }}"
  26. file:
  27. path: "{{ localpath}}{{ item }}/"
  28. state: directory
  29. owner: root
  30. group: root
  31. mode: '0777'
  32. loop: "{{ share }}"
  33. - name: setup service sshfs
  34. template:
  35. src: sshfs.service.j2
  36. dest: "/usr/lib/systemd/system/sshfs-{{ item }}.service"
  37. mode: 0644
  38. owner: root
  39. group: root
  40. loop: "{{ share }}"
  41. - name: "Sshfs {{ item }} service start"
  42. systemd:
  43. name: "sshfs-{{ item }}"
  44. state: started
  45. enabled: yes
  46. masked: no
  47. daemon_reload: yes
  48. loop: "{{ share }}"