mount partitions for glusterfs volumes
This commit is contained in:
@@ -14,16 +14,16 @@
|
||||
- xfsprogs
|
||||
- xfsdump
|
||||
|
||||
- name: Start service k3s, if not started
|
||||
- name: Start service gluster, if not started
|
||||
block:
|
||||
- name: start on home
|
||||
ansible.builtin.service:
|
||||
name: glusterd
|
||||
state: started
|
||||
when: "ansible_lsb.major_release >= '20'"
|
||||
# - name: start on home
|
||||
# ansible.builtin.service:
|
||||
# name: glusterd
|
||||
# state: started
|
||||
# when: "ansible_lsb.major_release >= '20'"
|
||||
|
||||
- name: start on cubox-i
|
||||
ansible.builtin.service:
|
||||
name: glusterfs-server
|
||||
state: started
|
||||
when: "ansible_lsb.major_release < '20'"
|
||||
when: ansible_architecture == 'armv7l'
|
||||
|
||||
@@ -1,13 +1,27 @@
|
||||
---
|
||||
# glusterfs mounts
|
||||
# Use 'blkid' to print the universally unique identifier for a
|
||||
# device; this may be used with UUID= as a more robust way to name devices
|
||||
# that works even if disks are added and removed. See fstab(5).
|
||||
#
|
||||
|
||||
# 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]}}"
|
||||
|
||||
# create mount points
|
||||
- name: create mount points for all bricks in all volumes
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
with_items: "{{mountpoints}}"
|
||||
#- name: create mount points for all bricks in all volumes
|
||||
# file:
|
||||
# path: "{{ item }}"
|
||||
# state: directory
|
||||
# mode: 0755
|
||||
# with_items: "{{mountpoints}}"
|
||||
|
||||
# manage volumes
|
||||
#- name: remove old gluster volumes
|
||||
@@ -21,18 +35,18 @@
|
||||
# run_once: true
|
||||
|
||||
|
||||
- name: create gluster volumes
|
||||
gluster_volume:
|
||||
state: present
|
||||
start_on_create: yes
|
||||
name: "{{ item.key }}"
|
||||
brick: '{{ item.value | join(",")}}'
|
||||
rebalance: no
|
||||
replicas: 2
|
||||
force: true
|
||||
cluster: "{{cluster}}"
|
||||
with_dict: "{{volumes}}"
|
||||
run_once: true
|
||||
#- name: create gluster volumes
|
||||
# gluster_volume:
|
||||
# state: present
|
||||
# start_on_create: yes
|
||||
# name: "{{ item.key }}"
|
||||
# brick: '{{ item.value | join(",")}}'
|
||||
# rebalance: no
|
||||
# replicas: 2
|
||||
# force: true
|
||||
# cluster: "{{cluster}}"
|
||||
# with_dict: "{{volumes}}"
|
||||
# run_once: true
|
||||
|
||||
#- name: create tmp gluster volumes
|
||||
# gluster_volume:
|
||||
@@ -44,14 +58,14 @@
|
||||
# cluster: "{{cluster}}"
|
||||
# run_once: true
|
||||
|
||||
- name: create distributed gluster volumes
|
||||
gluster_volume:
|
||||
state: present
|
||||
name: "{{ item.key }}"
|
||||
brick: '{{ item.value | join(",")}}'
|
||||
rebalance: no
|
||||
replicas: false
|
||||
force: true
|
||||
cluster: "{{cluster}}"
|
||||
with_dict: "{{distributed_volumes}}"
|
||||
run_once: true
|
||||
#- name: create distributed gluster volumes
|
||||
# gluster_volume:
|
||||
# state: present
|
||||
# name: "{{ item.key }}"
|
||||
# brick: '{{ item.value | join(",")}}'
|
||||
# rebalance: no
|
||||
# replicas: false
|
||||
# force: true
|
||||
# cluster: "{{cluster}}"
|
||||
# with_dict: "{{distributed_volumes}}"
|
||||
# run_once: true
|
||||
|
||||
Reference in New Issue
Block a user