main.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. fstype: none
  45. state: mounted
  46. # This would be one task if not for the SSL path fuckery
  47. - name: Install glusterfs-volume-plugin
  48. community.docker.docker_plugin:
  49. state: enable
  50. alias: glusterfs
  51. #https://github.com/marcelo-ochoa/docker-volume-plugins/
  52. plugin_name: "mochoa/glusterfs-volume-plugin-aarch64"
  53. plugin_options:
  54. SERVERS: "{{ docker_glusterfs_servers }}"
  55. SECURE_MANAGEMENT: true