-
Notifications
You must be signed in to change notification settings - Fork 0
/
03-gluster.yaml
63 lines (54 loc) · 1.51 KB
/
03-gluster.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
- name: Setup Gluster
hosts: gluster
vars_files:
- vars.yaml
tasks:
- name: Create a xfs filesystem for gluster
community.general.filesystem:
fstype: xfs
dev: "{{ gluster_volume_name }}"
opts: -i size=512
force: "{{ gluster_create_fs_force }}"
- name: Mount up device
mount:
path: "{{ gluster_mouth_path }}"
src: "{{ gluster_volume_name }}"
fstype: xfs
state: mounted
- name: Install required packages
yum:
name: "{{ gluster_packeges }}"
state: latest
- name: Install required packages
yum:
name: glusterfs-server
state: latest
- name: Gluster services are enabled
service:
name: glusterd
state: started
enabled: true
- name: Prepare peers list
set_fact:
peers_list: "{{ groups.gluster|difference([inventory_hostname]) }}"
- name: Create a trusted storage pool
gluster.gluster.gluster_peer:
state: present
nodes: "{{ peers_list }}"
- name: Create gv directory
file:
path: "{{ gluster_mouth_path }}/gv0"
state: directory
- name: Setup Gluster gv0 volume from node1
hosts: node1
vars_files:
- vars.yaml
tasks:
- name: Volume create
gluster.gluster.gluster_volume:
state: present
name: gv0
bricks: "{{ gluster_mouth_path }}/gv0"
replicas: "{{ groups.gluster | length }}"
cluster: "{{ groups.gluster }}"
run_once: true