Ansible repo for digital ocean projects
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

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