add gluster
This commit is contained in:
parent
94e732c767
commit
f84149991e
3 changed files with 51 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
|||
# bootstrap k3s cluster
|
||||
|
||||
## requirements
|
||||
|
||||
* 3 nodes, key-based SSH to root, empty sdb for gluster
|
||||
|
||||
## init repository
|
||||
|
||||
local requirements: wireguard-tools, yq, jq, ansible
|
||||
|
|
46
roles/gluster/tasks/main.yaml
Normal file
46
roles/gluster/tasks/main.yaml
Normal file
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
- name: install gluster package
|
||||
apt:
|
||||
name: glusterfs-server
|
||||
- name: start and enable gluster
|
||||
service:
|
||||
enabled: yes
|
||||
name: glusterd
|
||||
state: started
|
||||
- name: filesystem on gluster disk
|
||||
filesystem:
|
||||
dev: /dev/sdb
|
||||
fstype: ext4
|
||||
- name: mount gluster disk
|
||||
mount:
|
||||
path: /mnt/gluster
|
||||
src: /dev/sdb
|
||||
options: noatime
|
||||
fstype: ext4
|
||||
state: mounted
|
||||
- name: gluster peers
|
||||
gluster_peer:
|
||||
nodes:
|
||||
- node01
|
||||
- node02
|
||||
- node03
|
||||
- name: gluster volume
|
||||
gluster_volume:
|
||||
name: data
|
||||
replicas: 3
|
||||
state: started
|
||||
bricks: /mnt/gluster/data
|
||||
cluster:
|
||||
- node01
|
||||
- node02
|
||||
- node03
|
||||
- name: gluster client package
|
||||
apt:
|
||||
name: glusterfs-client
|
||||
- name: mount gluster brick
|
||||
mount:
|
||||
path: /data
|
||||
src: "{{ansible_nodename}}:/data"
|
||||
options: noatime
|
||||
fstype: glusterfs
|
||||
state: mounted
|
1
site.yml
1
site.yml
|
@ -4,3 +4,4 @@
|
|||
roles:
|
||||
- base
|
||||
- wireguard
|
||||
- gluster
|
||||
|
|
Loading…
Reference in a new issue