diff --git a/ansible-5/playbooks/glusterfs-cluster.yml b/ansible-5/playbooks/glusterfs-cluster.yml index f028359..d20652b 100644 --- a/ansible-5/playbooks/glusterfs-cluster.yml +++ b/ansible-5/playbooks/glusterfs-cluster.yml @@ -17,7 +17,7 @@ # glusterfs_daemon: glusterd cluster: - cubox-i - - cubox-m +# - cubox-m move_brick: - gitea diff --git a/ansible-5/roles/glusterfs-server/defaults/main.yaml b/ansible-5/roles/glusterfs-server/defaults/main.yaml index 64209ea..8306b62 100644 --- a/ansible-5/roles/glusterfs-server/defaults/main.yaml +++ b/ansible-5/roles/glusterfs-server/defaults/main.yaml @@ -21,11 +21,11 @@ volumes: brick_folder: brick # bricks found at "{{mounts.paths[gitea]}}/{{volumes.brick_folder}}" replicated: - - name: gitea - - name: jenkins - - name: vmshares +# - name: gitea +# - name: jenkins +# - name: vmshares # - name: mariadb -# - name: plex + - name: plex # - name: nextcloud2 # - name: prometheus # - name: tmp @@ -81,31 +81,32 @@ mounts: status: mounted src: "UUID=ced31b8e-8404-4bff-b428-6411c54451a4" - home: - - name: vmshares - status: mounted - src: "UUID=1ee11dc5-0b55-47bd-a92c-e644175a8ba9" - - name: gitea - status: mounted - src: "UUID=1a10b5b3-a00b-463c-bb47-d7a1430357c2" - - name: jenkins - status: mounted - src: "UUID=c1ae3332-8ccc-42c4-beb9-217e0dd58835" - - name: tmp - status: mounted - src: "UUID=cad3eb8f-bd07-499b-b1f0-19ec14ba0084" - - name: nextcloud - status: mounted - src: "UUID=179763ba-27cc-4dbf-a0b2-01596727c541" - - name: prometheus - status: mounted - src: "UUID=19ec83ce-cb19-465f-ba79-0426a659541d" - - name: mariadb - status: mounted - src: "UUID=fa3adff4-b456-4321-8528-eed843615191" - - name: plex - status: mounted - src: "UUID=2e87570b-4750-4aeb-926b-1d9b48ef89b3" - - name: nextcloud2 - status: mounted - src: "UUID=b0dc64be-80b1-49f6-ae0f-ae6219e734c9" + home: [] + cubox-m: [] +# - name: vmshares +# status: mounted +# src: "UUID=1ee11dc5-0b55-47bd-a92c-e644175a8ba9" +# - name: gitea +# status: mounted +# src: "UUID=1a10b5b3-a00b-463c-bb47-d7a1430357c2" +# - name: jenkins +# status: mounted +# src: "UUID=c1ae3332-8ccc-42c4-beb9-217e0dd58835" +# - name: tmp +# status: mounted +# src: "UUID=cad3eb8f-bd07-499b-b1f0-19ec14ba0084" +# - name: nextcloud +# status: mounted +# src: "UUID=179763ba-27cc-4dbf-a0b2-01596727c541" +# - name: prometheus +# status: mounted +# src: "UUID=19ec83ce-cb19-465f-ba79-0426a659541d" +# - name: mariadb +# status: mounted +# src: "UUID=fa3adff4-b456-4321-8528-eed843615191" +# - name: plex +# status: mounted +# src: "UUID=2e87570b-4750-4aeb-926b-1d9b48ef89b3" +# - name: nextcloud2 +# status: mounted +# src: "UUID=b0dc64be-80b1-49f6-ae0f-ae6219e734c9" diff --git a/ansible-5/roles/glusterfs-server/tasks/main.yml b/ansible-5/roles/glusterfs-server/tasks/main.yml index 02e99f0..735655b 100644 --- a/ansible-5/roles/glusterfs-server/tasks/main.yml +++ b/ansible-5/roles/glusterfs-server/tasks/main.yml @@ -9,7 +9,7 @@ - include_tasks: create_cluster.yaml -#- include_tasks: manage_volumes.yml +- include_tasks: volumes/main.yml ## doesn't work #- name: "check the underlying config" diff --git a/ansible-5/roles/glusterfs-server/tasks/volumes/fstab.yaml b/ansible-5/roles/glusterfs-server/tasks/volumes/fstab.yaml new file mode 100644 index 0000000..692f7c6 --- /dev/null +++ b/ansible-5/roles/glusterfs-server/tasks/volumes/fstab.yaml @@ -0,0 +1,12 @@ +--- +# tasks/volumes/fstab +# setup storage volumes + +- name: Create fstab entries + ansible.posix.mount: + path: "{{ mounts.paths[item.name] }}" + src: "{{ item.src }}" + fstype: "xfs" + opts: "defaults,noatime,nofail,x-systemd.device-timeout=10 0 0" + state: "{{ item.status }}" + with_items: "{{mounts[inventory_hostname]}}" diff --git a/ansible-5/roles/glusterfs-server/tasks/manage_volumes.yml b/ansible-5/roles/glusterfs-server/tasks/volumes/main.yml similarity index 51% rename from ansible-5/roles/glusterfs-server/tasks/manage_volumes.yml rename to ansible-5/roles/glusterfs-server/tasks/volumes/main.yml index 53e8b1c..ed08d81 100644 --- a/ansible-5/roles/glusterfs-server/tasks/manage_volumes.yml +++ b/ansible-5/roles/glusterfs-server/tasks/volumes/main.yml @@ -6,19 +6,7 @@ # # Mount drives in fstab -- name: Create fstab entries - ansible.posix.mount: - path: "{{ mounts.paths[item.name] }}" - src: "{{ item.src }}" - fstype: "xfs" - opts: "defaults,noatime,nofail,x-systemd.device-timeout=10 0 0" - state: "{{ item.status }}" - with_items: "{{mounts[inventory_hostname]}}" - -- name: create pool - gluster.gluster.gluster_peer: - state: present - nodes: "{{ cluster }}" +- include_tasks: fstab.yaml # manage volumes @@ -43,15 +31,15 @@ with_items: "{{volumes.replicated}}" run_once: true -- name: create distributed gluster volumes - gluster_volume: - state: present - name: "{{ item.name }}" - brick: "{{mounts.paths[item.name]}}/{{volumes.brick_folder}}" - rebalance: no - replicas: false -# force: true - cluster: "{{cluster}}" - with_items: "{{volumes.distributed}}" - run_once: true +#- name: create distributed gluster volumes +# gluster_volume: +# state: present +# name: "{{ item.name }}" +# brick: "{{mounts.paths[item.name]}}/{{volumes.brick_folder}}" +# rebalance: no +# replicas: false +## force: true +# cluster: "{{cluster}}" +# with_items: "{{volumes.distributed}}" +# run_once: true diff --git a/ansible-5/roles/glusterfs-server/tasks/remove_volume.yml b/ansible-5/roles/glusterfs-server/tasks/volumes/remove_volume.yml similarity index 100% rename from ansible-5/roles/glusterfs-server/tasks/remove_volume.yml rename to ansible-5/roles/glusterfs-server/tasks/volumes/remove_volume.yml