-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdistributed-server.yml
More file actions
executable file
·174 lines (147 loc) · 4.42 KB
/
distributed-server.yml
File metadata and controls
executable file
·174 lines (147 loc) · 4.42 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
- hosts: all
gather_facts: yes
vars:
- scratchdir: /tmp/gluster-test
- version: HEAD
tasks:
- lineinfile:
dest: /etc/sysconfig/network-scripts/ifcfg-eth0
regexp: ^IPV6INIT=
line: IPV6INIT=no
name: Disable ipv6 in eth0 config
- lineinfile:
dest: /etc/sysconfig/network
regexp: ^NETWORKING_IPV6=
line: NETWORKING_IPV6=no
name: Disable ipv6 in network config
- name: Disable ipv6 in sysctl
sysctl:
name: "{{ item }}"
value: 1
state: present
reload: yes
with_items:
- net.ipv6.conf.all.disable_ipv6
- net.ipv6.conf.default.disable_ipv6
- name: Load kernel parameters
command: sysctl -p
# use "install ipv6 /bin/true", since that's what ip6tables check to see if
# ipv6 is disabled. See reload function on /etc/init.d/ip6tables on RHEL 6.
- copy:
dest: /etc/modprobe.d/ipv6.conf
content: "options ipv6 disable=1\ninstall ipv6 /bin/true"
name: Disable ipv6 module
- name: Clean hosts
lineinfile:
state: absent
dest: /etc/hosts
regexp: "^(10\\.|2001:|::1)"
- name: Setup hosts file so that IP is in /etc/hosts
lineinfile:
state: present
dest: /etc/hosts
line: "{{ ansible_eth0['ipv4']['address'] }} {{ ansible_nodename }}"
regexp: "^{{ ansible_eth0['ipv4']['address'] }}.*"
- name: Make sure firewalld allows traffic from the machine to itself
firewalld:
rich_rule: "rule family='ipv4' source address='{{ansible_eth0['ipv4']['address']}}' accept"
permanent: true
state: enabled
- name: Make sure eth0 is enabled
lineinfile:
state: present
dest: /etc/sysconfig/network-scripts/ifcfg-eth0
regexp: ^ONBOOT=
line: ONBOOT=yes
- name: Make sure eth1 is disabled
lineinfile:
state: present
dest: /etc/sysconfig/network-scripts/ifcfg-eth1
regexp: ^ONBOOT=
line: ONBOOT=no
when: ansible_eth1 is defined
- name: Create the data file
command: fallocate -l 10G /var/data
args:
creates: /var/data
- name: Format data file to xfs
filesystem:
fstype: xfs
dev: /var/data
- name: Mount /d
mount:
path: /d
src: /var/data
fstype: xfs
state: mounted
- name: Start and enable rpc-statd
service:
name: rpc-statd
enabled: true
state: started
- name: Create the file to be used for swap
command: dd if=/dev/zero of=/root/swapfile bs=1024 count=2097152
- name: Format the file for swap
command: mkswap /root/swapfile
- name: Change swap file permissions
file: path=/root/swapfile owner=root group=root mode=0600
- name: Add the file to the system as a swap file
command: swapon /root/swapfile
- name: Write swap entry in fstab
mount: name=none src=/root/swapfile fstype=swap opts=sw passno=0 dump=0 state=present
- name: Open a port for XMLRPC connection
firewalld:
rich_rule: "rule family='ipv4' source address='8.43.85.181' port port=9999 protocol='tcp' accept"
state: enabled
immediate: yes
permanent: true
- name: Clone the glusterfs code
git:
repo: 'git://review.gluster.org/glusterfs'
dest: '{{ scratchdir }}/glusterfs'
version: '{{ version }}'
update: yes
force: yes
- name: Build glusterfs
shell: |
./autogen.sh
./configure --disable-bd-xlator --enable-debug --enable-gnfs --silent
make install
args:
chdir: '{{ scratchdir }}/glusterfs'
- shell: ssh-keygen -q -P '' -C "key for georep test" -f /root/.ssh/id_georep
name: Generate a key for georep
args:
creates: /root/.ssh/id_georep
- shell: cat /root/.ssh/id_georep.pub
name: Get the public key
register: georep_pub_key
changed_when: False
- name: Link the key to the default key
file:
state: link
src: /root/.ssh/id_georep{{ item }}
dest: /root/.ssh/id_rsa{{ item }}
with_items:
- ''
- '.pub'
- authorized_key:
user: root
key: "{{ georep_pub_key.stdout }}"
key_options: 'from="127.0.0.1"'
name: Add authorized_key for georep tests
- name: Create directory for storing the logs
file:
path: '/tmp/failed-tests'
state: directory
delegate_to: localhost
tags:
- copy_logs
- name: Copy glusterfs logs
synchronize:
src: '/var/log/glusterfs'
dest: '/tmp/failed-tests/{{ ansible_nodename }}'
mode: pull
tags:
- copy_logs