-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_moosefs_ppa.yml
202 lines (156 loc) · 5.6 KB
/
install_moosefs_ppa.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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
## Warning, this could be very destructive, as it attempts to install a new filesystem MooseFS. Use only after discussion with
## Colin and never use with HPCALL inventory
- hosts: MOOSEFS
remote_user: rcug
become: yes
tasks:
- name: Add downloaded moosefs repo gpg key
apt_key:
file: /working/rcug/slurm/moosefs/moosefs.key
state: present
- name: Add moosefs repo
apt_repository:
repo: deb http://ppa.moosefs.com/moosefs-3/apt/ubuntu/xenial xenial main
state: present
- name: Update APT cache
apt:
update_cache: yes
cache_valid_time: 3600
allow_unauthenticated: yes
############
## Master
############
- name: Master Install moosefs-master on hpc06 and hpc-vm2
apt: pkg={{ item }} state='latest' install_recommends=no allow_unauthenticated=yes
with_items:
- moosefs-master
- moosefs-cgi
- moosefs-cgiserv
- moosefs-cli
- moosefs-cgi
- moosefs-cgiserv
when: ansible_hostname == "hpc06" or ansible_hostname == "hpc-vm2"
- name: Setup moosefs permissions and folder 1
file: path={{ item }} state=directory owner=mfs group=mfs
with_items:
- /etc/mfs/
when: ansible_hostname == "hpc06" or ansible_hostname == "hpc-vm2"
- name: Master Copy the sample mfsmaster file
ignore_errors: True
copy:
src: /etc/mfs/mfsmaster.cfg.sample
dest: /etc/mfs/mfsmaster.cfg
when: ansible_hostname == "hpc06" or ansible_hostname == "hpc-vm2"
- name: Master Copy the sample mfsexports file
ignore_errors: True
copy:
src: /etc/mfs/mfsexports.cfg.sample
dest: /etc/mfs/mfsexports.cfg
when: ansible_hostname == "hpc06" or ansible_hostname == "hpc-vm2"
- name: Master Copy the metadata file
ignore_errors: True
copy:
src: /var/lib/mfs/metadata.mfs.empty
dest: /var/lib/mfs/metadata.mfs
when: ansible_hostname == "hpc06" or ansible_hostname == "hpc-vm2"
- name: Setup moosefs permissions and folder
file: path={{ item }} state=file owner=mfs group=mfs
with_items:
- /var/lib/mfs/metadata.mfs
when: ansible_hostname == "hpc06" or ansible_hostname == "hpc-vm2"
- name: Delete /var/lib/mfs/metadata.mfs.empty
file: path={{ item }} state=absent
with_items:
- /var/lib/mfs/metadata.mfs.empty
when: ansible_hostname == "hpc06" or ansible_hostname == "hpc-vm2"
- name: Start moosefs master
shell: mfsmaster restart
when: ansible_hostname == "hpc06" or ansible_hostname == "hpc-vm2"
- name: Start moosefs web
shell: mfscgiserv restart
when: ansible_hostname == "hpc06" or ansible_hostname == "hpc-vm2"
####################
#### Chunkservers
####################
- name: Chunkservers Install moosefs-chunkservers
apt: pkg={{ item }} state='latest' install_recommends=no allow_unauthenticated=yes
with_items:
- moosefs-chunkserver
when: ansible_hostname != "hpc06" and ansible_hostname != "hpc-vm2"
- name: Chunkservers Setup data partitions
become: yes
ignore_errors: True
file: path={{ item }} state=directory owner=mfs group=mfs mode=0770
with_items:
- /data/moosefs
- /ssd/moosefs
when: ansible_hostname != "hpc06" and ansible_hostname != "hpc-vm2"
- name: Chunkservers Copy the sample mfschunkserver file
become: yes
ignore_errors: True
copy:
src: /etc/mfs/mfschunkserver.cfg.sample
dest: /etc/mfs/mfschunkserver.cfg
when: ansible_hostname != "hpc06" and ansible_hostname != "hpc-vm2"
- name: Chunkservers Copy the sample mfshdd file
become: yes
ignore_errors: True
copy:
src: /etc/mfs/mfshdd.cfg.sample
dest: /etc/mfs/mfshdd.cfg
when: ansible_hostname != "hpc06" and ansible_hostname != "hpc-vm2"
- name: Change line in file to add partition /data
become: yes
lineinfile:
path: /etc/mfs/mfshdd.cfg
state: present
line: "/data/moosefs"
backup: yes
when: ansible_hostname != "hpc06" and ansible_hostname != "hpc-vm2"
- name: Change line in file to add partition /ssd
become: yes
lineinfile:
path: /etc/mfs/mfshdd.cfg
state: present
line: "/ssd/moosefs"
backup: yes
when: ansible_hostname != "hpc06" and ansible_hostname != "hpc-vm2"
- name: Start chunkservers
shell: mfschunkserver restart
when: ansible_hostname != "hpc06" and ansible_hostname != "hpc-vm2"
###################
## MooseFS clients - mounts
##################
- name: Clientservers Install moosefs-client and fuse
apt: pkg={{ item }} state='latest' install_recommends=no allow_unauthenticated=yes
with_items:
- moosefs-client
- fuse
- libfuse2
when: ansible_hostname != "hpc06" and ansible_hostname != "hpc-vm2"
- name: Mount moosefs
mount:
fstype: moosefs
opts: defaults,mfsdelayedinit 0 0
path: /mnt/mfs
src: "172.24.8.26:"
state: mounted
when: ansible_hostname != "hpc06" and ansible_hostname != "hpc-vm2"
##############
# Metalogger on hpc05
##############
- name: Install moosefs-metalogger
apt: pkg={{ item }} state='latest' install_recommends=no allow_unauthenticated=yes
with_items:
- moosefs-metalogger
when: ansible_hostname == "hpc05"
- name: Start metalogger
shell: mfsmetalogger start
when: ansible_hostname == "hpc05"
- name: Metalogger Copy the sample mfshdd file
become: yes
ignore_errors: True
copy:
src: /etc/mfs/mfsmetalogger.cfg.sample
dest: /etc/mfs/mfsmetalogger.cfg
when: ansible_hostname == "hpc05"