main.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. - name: "Create {{ docker_glusterfs_pluginssl }}"
  2. file:
  3. path: "{{ docker_glusterfs_pluginssl }}"
  4. owner: "{{ docker_glusterfs_owner }}"
  5. group: "{{ docker_glusterfs_group }}"
  6. mode: "{{ docker_glusterfs_dirmode }}"
  7. state: directory
  8. register: docker_glusterfs_createssl
  9. - name: Copy {{ docker_glusterfs_hostssl }} to {{ docker_glusterfs_pluginssl }}
  10. ansible.builtin.copy:
  11. remote_src: true
  12. src: "{{ docker_glusterfs_hostssl }}/"
  13. dest: "{{ docker_glusterfs_pluginssl }}/"
  14. when: docker_glusterfs_createssl.changed
  15. - name: Install the SSL CA
  16. ansible.builtin.copy:
  17. remote_src: true
  18. src: "{{ docker_glusterfs_keydir }}/ca.pem"
  19. dest: "{{ docker_glusterfs_pluginssl }}/glusterfs.ca"
  20. owner: "{{ docker_glusterfs_owner }}"
  21. group: "{{ docker_glusterfs_group }}"
  22. mode: "{{ docker_glusterfs_mode }}"
  23. - name: Install the SSL certificate
  24. ansible.builtin.copy:
  25. remote_src: true
  26. src: "{{ docker_glusterfs_keydir }}/node.pem"
  27. dest: "{{ docker_glusterfs_pluginssl }}/glusterfs.pem"
  28. owner: "{{ docker_glusterfs_owner }}"
  29. group: "{{ docker_glusterfs_group }}"
  30. mode: "{{ docker_glusterfs_mode }}"
  31. - name: Install the SSL key
  32. ansible.builtin.copy:
  33. remote_src: true
  34. src: "{{ docker_glusterfs_keydir }}/node.key"
  35. dest: "{{ docker_glusterfs_pluginssl }}/glusterfs.key"
  36. owner: "{{ docker_glusterfs_owner }}"
  37. group: "{{ docker_glusterfs_group }}"
  38. mode: "{{ docker_glusterfs_mode }}"
  39. - name: Mount {{ docker_glusterfs_pluginssl }} @ {{ docker_glusterfs_hostssl }}
  40. ansible.posix.mount:
  41. path: "{{ docker_glusterfs_hostssl }}"
  42. src: "{{ docker_glusterfs_pluginssl }}"
  43. opts: bind
  44. boot: no
  45. fstype: none
  46. state: mounted
  47. # This would be one task if not for the SSL path fuckery
  48. - name: Install glusterfs-volume-plugin
  49. community.docker.docker_plugin:
  50. state: enable
  51. alias: glusterfs
  52. #https://github.com/marcelo-ochoa/docker-volume-plugins/
  53. plugin_name: "mochoa/glusterfs-volume-plugin-aarch64"
  54. plugin_options:
  55. SERVERS: "{{ docker_glusterfs_servers }}"
  56. SECURE_MANAGEMENT: true