Ansible repo for digital ocean projects
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

44 rader
1.3 KiB

  1. ---
  2. - name: Install SSHFS
  3. apt: pkg=sshfs state=latest update_cache=true
  4. become: yes
  5. - name: Unmount (fusermount) Media Directory
  6. command: fusermount -u {{ remote_media_directory }}
  7. become: yes
  8. ignore_errors: yes
  9. - name: Unmount (umount) Media Directory
  10. command: umount -l {{ remote_media_directory }}
  11. become: yes
  12. ignore_errors: yes
  13. - name: Remove Media Directory
  14. command: rmdir {{ remote_media_directory }}
  15. become: yes
  16. ignore_errors: yes
  17. - name: Copy SSHFS Configuration
  18. template: src={{ item.src }} dest={{ item.dest }} owner={{ item.owner }} group={{ item.group }} mode={{ item.mode }}
  19. with_items:
  20. - {src: fuse.conf, dest: "/etc/fuse.conf", owner: "{{ ssh_username }}", group: "{{ ssh_username }}", mode: "0777"}
  21. - {src: ssh_config, dest: "/etc/ssh/ssh_config", owner: "{{ ssh_username }}", group: "{{ ssh_username }}", mode: "0777"}
  22. - {src: sshfs_script.j2, dest: "/etc/sshfs_script", owner: "{{ ssh_username }}", group: "{{ ssh_username }}", mode: "0777"}
  23. become: yes
  24. - name: Add User to Fuse Group
  25. command: gpasswd -a $USER fuse
  26. become: yes
  27. - name: Create Media Directory
  28. command: mkdir {{ remote_media_directory }}
  29. become: yes
  30. - name: Mount Media Directory
  31. shell: /etc/sshfs_script
  32. args:
  33. executable: /bin/bash
  34. become: yes