-
Notifications
You must be signed in to change notification settings - Fork 6
/
test_setup.splitbrain.yml
75 lines (70 loc) · 2.32 KB
/
test_setup.splitbrain.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
---
# ===========================================
# QE configuration for invoking split brain
# ===========================================
#
# Requirements of this playbook:
#
# * gluster volume with AFR tranlator
# * 2 client machines in usm_client group
# * some already existing non empty text file on the gluster volume (a victiom
# of a split brain related test case)
#
# To use this playbook, create 2 new groups in inventory file:
#
# * gluster_splitbrain0
# * gluster_splitbrain1
#
# Populating these groups requires you to understand replica set configuration
# of your volume. Moreover you need to figure out on which the file to be split
# brained resides.
#
# Besides that you need to update volume_name variable if you don't use
# volume_alpha_distrep_6x2.
#
# This playbook then makes sure that all network traffic is dropped for:
#
# * connections from usm_client[0] machine to gluster_splitbrain0 machines
# * connections from usm_client[1] machine to gluster_splitbrain1 machines
#
# This way, you can update some same already existing file from both clients
# and create a split brain situation.
#
# Based on upstream GlusterFS documentation:
#
# https://docs.gluster.org/en/latest/Administrator%20Guide/Split%20brain%20and%20ways%20to%20deal%20with%20it/#split-brain
- hosts: usm_client[0]
remote_user: root
tasks:
- name: Drop all traffic to gluster_splitbrain0 machines
iptables:
action: insert
state: present
chain: OUTPUT
destination: "{{ item }}"
jump: DROP
with_items: "{{ groups['gluster_splitbrain0'] }}"
- hosts: usm_client[1]
remote_user: root
vars:
volume_mountpoint: "/mnt/volume_tmp_splitbrain"
volume_name: "volume_alpha_distrep_6x2"
tasks:
- name: Create new mountpoint just for splitbrain
file:
path: "{{ volume_mountpoint }}"
state: directory
- name: Mount GlusterSF volume for splitbrain purposes there
mount:
path: "{{ volume_mountpoint }}"
fstype: glusterfs
src: "{{ groups['gluster_servers'][0] }}:{{ volume_name }}"
state: mounted
- name: Drop all traffic to gluster_splitbrain1 machines
iptables:
action: insert
state: present
chain: OUTPUT
destination: "{{ item }}"
jump: DROP
with_items: "{{ groups['gluster_splitbrain1'] }}"