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.

43 lignes
1.1 KiB

  1. ---
  2. - hosts: mpdb, mpdf
  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: 22000
  12. tasks:
  13. - name: sshfs install
  14. apt:
  15. name: sshfs
  16. state: latest
  17. update_cache: yes
  18. - name: copy private key
  19. copy:
  20. src: "./sshfs-key"
  21. dest: "/root/.ssh/"
  22. owner: root
  23. group: root
  24. mode: '0700'
  25. - name: copy ssh config
  26. copy:
  27. src: "./ssh-config"
  28. dest: "/root/.ssh/config"
  29. owner: root
  30. group: root
  31. mode: '0700'
  32. - name: "sshfs mount {{ item }}"
  33. file:
  34. path: "{{ localpath}}{{ item }}/"
  35. state: directory
  36. owner: root
  37. group: root
  38. mode: '0777'
  39. loop: "{{ share }}"
  40. - name: "mount {{ item}}"
  41. ansible.builtin.shell: "/usr/bin/sshfs -o reconnect,allow_root,allow_other,_netdev {{ [username,'@',hostname,':',remotepath,item,'/',' ',localpath,item,'/' ]|join() }}"
  42. loop: "{{ share }}"