Ansible repo for digital ocean projects
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

47 linhas
1.1 KiB

  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 }}"